Having these not be the same makes an easy to misuse API. We should audit the
uses and probably rename to something like
foo->hasExternalLinkage():
The c++ standard one. That is UniqueExternalLinkage or ExternalLinkage.
foo->hasUniqueExternalLinkage():
Is UniqueExternalLinkage.
foo->hasCogeGenExternalLinkage():
Is ExternalLinkage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178768
91177308-0d34-0410-b5e6-
96231b3b80d8
// storage classes.
if (!isa<CXXMethodDecl>(New) && !isa<CXXMethodDecl>(Old) &&
New->getStorageClass() == SC_Static &&
- Old->hasExternalLinkage() &&
+ isExternalLinkage(Old->getLinkage()) &&
!New->getTemplateSpecializationInfo() &&
!canRedefineFunction(Old, getLangOpts())) {
if (getLangOpts().MicrosoftExt) {
extern void a();
static void a(void) {}
}
+
+namespace test14 {
+ namespace {
+ void a(void); // expected-note {{previous declaration is here}}
+ static void a(void) {} // expected-error {{static declaration of 'a' follows non-static declaration}}
+ }
+}