[meta] Ctor name lookup is not enough for the class info - #23098
Open
dpiparo wants to merge 2 commits into
Open
Conversation
pcanal
reviewed
Aug 18, 2026
Test Results 23 files 23 suites 3d 13h 25m 30s ⏱️ Results for commit 9be4eb2. ♻️ This comment has been updated with latest results. |
the mechanism in place to allow the initialisation of TClingClassInfo based on names of forward declared classes was a bit too loose. It also allowed for finding a class by the name of its constructor. Fixes ROOT-10311
pcanal
reviewed
Aug 20, 2026
| if (const auto *TD = type->getAsTagDecl()) { | ||
| decl = TD; | ||
| const auto *CXXRD = type->getAsCXXRecordDecl(); | ||
| if (CXXRD && !CXXRD->hasDefinition()) { |
Member
There was a problem hiding this comment.
Suggested change
| if (CXXRD && !CXXRD->hasDefinition()) { | |
| if (CXXRD && CXXRD->NamedDecl::isUnconditionallyVisible()) { |
However, it may be actually more semantically correct, to move this check into quickFindDecl possibly around line 226:
226 next = utils::Lookup::Named(&S, declName.substr(last, c - last), sofar);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The mechanism in place to allow the initialisation of TClingClassInfo based on names of forward declared classes was a bit too loose. It also allowed for finding a class by the name of its constructor.
The new mechanism is more explicit about the properties of the CXXRecordDecl identified by the lookup (if any).
Fixes ROOT-10311