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() {
10058
10058
// For a function defined inline within a class template, force the
10059
10059
// canonical definition to be the one inside the canonical definition of
10060
10060
// 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.
10062
10064
//
10063
10065
// Sadly we can't do this more generally: we can't be sure that all
10064
10066
// copies of an arbitrary class definition will have the same members
10065
10067
// defined (eg, some member functions may not be instantiated, and some
10066
10068
// 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 ;
10070
10073
10071
10074
// FIXME: Check for =delete/=default?
10072
10075
const FunctionDecl *Defn = nullptr ;
You can’t perform that action at this time.
0 commit comments