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