File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -10058,15 +10058,18 @@ void ASTReader::finishPendingActions() {
1005810058 // For a function defined inline within a class template, force the
1005910059 // canonical definition to be the one inside the canonical definition of
1006010060 // the template. This ensures that we instantiate from a correct view
10061- // of the template.
10061+ // of the template. This behaviour seems to be important only for inline
10062+ // friend functions. For normal member functions, it might results in
10063+ // selecting canonical decl from module A but body from module B.
1006210064 //
1006310065 // Sadly we can't do this more generally: we can't be sure that all
1006410066 // copies of an arbitrary class definition will have the same members
1006510067 // defined (eg, some member functions may not be instantiated, and some
1006610068 // special members may or may not have been implicitly defined).
10067- if (auto *RD = dyn_cast<CXXRecordDecl>(FD->getLexicalParent ()))
10068- if (RD->isDependentContext () && !RD->isThisDeclarationADefinition ())
10069- continue ;
10069+ if (FD->getFriendObjectKind ())
10070+ if (auto *RD = dyn_cast<CXXRecordDecl>(FD->getLexicalParent ()))
10071+ if (RD->isDependentContext () && !RD->isThisDeclarationADefinition ())
10072+ continue ;
1007010073
1007110074 // FIXME: Check for =delete/=default?
1007210075 const FunctionDecl *Defn = nullptr ;
You can’t perform that action at this time.
0 commit comments