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() {
10281
10281
// For a function defined inline within a class template, force the
10282
10282
// canonical definition to be the one inside the canonical definition of
10283
10283
// 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.
10285
10287
//
10286
10288
// Sadly we can't do this more generally: we can't be sure that all
10287
10289
// copies of an arbitrary class definition will have the same members
10288
10290
// defined (eg, some member functions may not be instantiated, and some
10289
10291
// 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 ;
10293
10296
10294
10297
// FIXME: Check for =delete/=default?
10295
10298
const FunctionDecl *Defn = nullptr ;
You can’t perform that action at this time.
0 commit comments