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 @@ -10281,15 +10281,18 @@ void ASTReader::finishPendingActions() {
1028110281 // For a function defined inline within a class template, force the
1028210282 // canonical definition to be the one inside the canonical definition of
1028310283 // the template. This ensures that we instantiate from a correct view
10284- // of the template.
10284+ // of the template. This behaviour seems to be important only for inline
10285+ // friend functions. For normal member functions, it might results in
10286+ // selecting canonical decl from module A but body from module B.
1028510287 //
1028610288 // Sadly we can't do this more generally: we can't be sure that all
1028710289 // copies of an arbitrary class definition will have the same members
1028810290 // defined (eg, some member functions may not be instantiated, and some
1028910291 // special members may or may not have been implicitly defined).
10290- if (auto *RD = dyn_cast<CXXRecordDecl>(FD->getLexicalParent ()))
10291- if (RD->isDependentContext () && !RD->isThisDeclarationADefinition ())
10292- continue ;
10292+ if (FD->getFriendObjectKind ())
10293+ if (auto *RD = dyn_cast<CXXRecordDecl>(FD->getLexicalParent ()))
10294+ if (RD->isDependentContext () && !RD->isThisDeclarationADefinition ())
10295+ continue ;
1029310296
1029410297 // FIXME: Check for =delete/=default?
1029510298 const FunctionDecl *Defn = nullptr ;
You can’t perform that action at this time.
0 commit comments