-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
| Bugzilla Link | 22842 |
| Version | trunk |
| OS | All |
| Reporter | LLVM Bugzilla Contributor |
Extended Description
Instantiated CXXMethods (e.g. CXXConstructorDecl) in TemplateDeclInstantiator (SemaTemplateInstantiateDecl.cpp) can go through one of two code paths.
- Thru
VisitFunctionTemplateDecl->VisitCXXMethodDecl->VisitCXXMethodDeclin which case they are not added to theOwnerDeclContextbyVisitCXXMethodDecldue to
// If there's a function template, let our caller handle it.
if (FunctionTemplate) {but indeed added to DeclContext by the caller VisitFunctionTemplateDecl:
Owner->addDecl(InstTemplate);- Thru
VisitCXXConstructorDecl->VisitCXXMethodDecl->VisitCXXMethodDeclin which case, althoughVisitCXXMethodDeclexpects the caller toaddDeclto theDeclContext, it does not do so as far as I could follow the code.
I don't know if this is a bug but it does seem inconsistent behaviour between the two cases and with comment.
Shouldn't all CXXMethods be addDecl-ed to some DeclConext?
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"