Repository navigation
Conversation
Test Results 23 files 23 suites 3d 16h 35m 2s ⏱️ For more details on these failures, see this check. Results for commit b68801b. ♻️ 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
| if (const auto *TD = type->getAsTagDecl()) { | ||
| decl = TD; | ||
| const auto *CXXRD = type->getAsCXXRecordDecl(); | ||
| if (CXXRD && !CXXRD->hasDefinition()) { |
There was a problem hiding this comment.
| 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);
There was a problem hiding this comment.
I was wrong, the issue is not with 'hidden' decls but with injected decls. I am uploading a fix (to quickFindDecl) that addresses the underlying issue and leave this code as-is. With the new change, the test passes.
| if (!decl && type) { | ||
| if (const auto *TD = type->getAsTagDecl()) { | ||
| decl = TD; | ||
| const auto *CXXRD = type->getAsCXXRecordDecl(); |
There was a problem hiding this comment.
I'm curious since this dropped getAsTagDecl I assume something like:
gInterpreter->Declare("enum class E : int;");
gInterpreter->ClassInfo_Factory("E");would not work. Why not just check for a definition on the TagDecl instead? as I think that would still reject TTree::TTree:
if (const auto *TD = type->getAsTagDecl(); TD && !TD->getDefinition())
decl = TD;but perhaps I'm missing another reason why we should restrict on CXXRecordDecl
There was a problem hiding this comment.
The choice of CXXRecordDecl is solely this commit 842767f#diff-fb8b9374813e714b3d3b31ba080d2c8121fc3f3882ac775a6cd0904e3a2e882aR102-R103 .
All that code seems to be there to get a grip onto class fwd declarations. TagDecls are a way to achieve that, but it's not always working, and therefore the more stringent check
There was a problem hiding this comment.
The example given above works after the patch in this PR is applied. No need to apply further changes...
Before this commit, quickFindDecl would 'find' something for `TTree::TTree` which is injected-class-name ([class]p2).
This reverts commit 1a29ee1abffbeb5da0a3c3545c43140bee29940c.
|
The only failures are preexisting/transient errors on alma9: |
vgvassilev
left a comment
There was a problem hiding this comment.
This looks reasonable to me.
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