Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Sema/SemaDecl.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 1,588 Lines • ▼ Show 20 Lines | bool Sema::CheckRedeclarationModuleOwnership(NamedDecl *New, NamedDecl *Old) { | ||||
// [module.interface]p7: | // [module.interface]p7: | ||||
// A declaration is attached to a module as follows: | // A declaration is attached to a module as follows: | ||||
// - If the declaration is a non-dependent friend declaration that nominates a | // - If the declaration is a non-dependent friend declaration that nominates a | ||||
// function with a declarator-id that is a qualified-id or template-id or that | // function with a declarator-id that is a qualified-id or template-id or that | ||||
// nominates a class other than with an elaborated-type-specifier with neither | // nominates a class other than with an elaborated-type-specifier with neither | ||||
// a nested-name-specifier nor a simple-template-id, it is attached to the | // a nested-name-specifier nor a simple-template-id, it is attached to the | ||||
// module to which the friend is attached ([basic.link]). | // module to which the friend is attached ([basic.link]). | ||||
if (New->getFriendObjectKind() && | if (New->getFriendObjectKind() && | ||||
Old->getOwningModuleForLinkage() != New->getOwningModuleForLinkage()) { | Old->getModuleAttachment() != New->getModuleAttachment()) { | ||||
New->setLocalOwningModule(Old->getOwningModule()); | New->setLocalOwningModule(Old->getOwningModule()); | ||||
makeMergedDefinitionVisible(New); | makeMergedDefinitionVisible(New); | ||||
return false; | return false; | ||||
} | } | ||||
Module *NewM = New->getOwningModule(); | Module *NewM = New->getOwningModule(); | ||||
Module *OldM = Old->getOwningModule(); | Module *OldM = Old->getOwningModule(); | ||||
▲ Show 20 Lines • Show All 17,225 Lines • Show Last 20 Lines |