the update set rather than the current DeclContext. Add test for the local
extern case too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204568
91177308-0d34-0410-b5e6-
96231b3b80d8
// function with a local extern declaration, for instance.
if (D->isOutOfLine()) {
auto *NS = dyn_cast<NamespaceDecl>(D->getDeclContext()->getRedeclContext());
+ // FIXME: Also update surrounding inline namespaces.
if (NS && NS->isFromASTFile())
- Writer.AddUpdatedDeclContext(NS);
+ Writer.AddUpdatedDeclContext(NS->getPrimaryContext());
}
}
void TriggerInstantiation() {
UseDefinedInBImpl<void>();
+ Std::f<int>();
}
friend bool operator!=(const WithFriend &A, const WithFriend &B) { return false; }
};
}
+
+namespace Std {
+ template<typename T> void f() {
+ extern T g();
+ }
+}
return wfi != wfi;
}
+namespace Std {
+ void g(); // expected-error {{functions that differ only in their return type cannot be overloaded}}
+ // expected-note@cxx-templates-common.h:21 {{previous}}
+}
+
// CHECK-GLOBAL: DeclarationName 'f'
// CHECK-GLOBAL-NEXT: |-FunctionTemplate {{.*}} 'f'
// CHECK-GLOBAL-NEXT: `-FunctionTemplate {{.*}} 'f'