Enum->setInstantiationOfMemberEnum(D, TSK_ImplicitInstantiation);
Enum->setAccess(D->getAccess());
+ // Forward the mangling number from the template to the instantiated decl.
+ SemaRef.Context.setManglingNumber(Enum, SemaRef.Context.getManglingNumber(D));
if (SubstQualifier(D, Enum)) return 0;
Owner->addDecl(Enum);
if (D->isLocalClass())
SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Record);
+ // Forward the mangling number from the template to the instantiated decl.
+ SemaRef.Context.setManglingNumber(Record,
+ SemaRef.Context.getManglingNumber(D));
+
Owner->addDecl(Record);
// DR1484 clarifies that the members of a local class are instantiated as part
if (Tmpl->isDeleted())
New->setDeletedAsWritten();
+ // Forward the mangling number from the template to the instantiated decl.
+ SemaRef.Context.setManglingNumber(New,
+ SemaRef.Context.getManglingNumber(Tmpl));
+
// If we are performing substituting explicitly-specified template arguments
// or deduced template arguments into a function template and we reach this
// point, we are now past the point where SFINAE applies and have committed
NewVar->setInstantiationOfStaticDataMember(OldVar,
TSK_ImplicitInstantiation);
+ // Forward the mangling number from the template to the instantiated decl.
+ Context.setManglingNumber(NewVar, Context.getManglingNumber(OldVar));
+
// Delay instantiation of the initializer for variable templates until a
// definition of the variable is needed.
if (!isa<VarTemplateSpecializationDecl>(NewVar) && !InstantiatingVarTemplate)
template short returnShort<-32768>();
// CHECK: @_ZN6test1311returnShortILsn32768EEEsv()
}
+
+namespace test14 {
+ template <typename> inline int inl(bool b) {
+ if (b) {
+ static struct {
+ int field;
+ } a;
+ // CHECK: @_ZZN6test143inlIvEEibE1a
+
+ return a.field;
+ } else {
+ static struct {
+ int field;
+ } a;
+ // CHECK: @_ZZN6test143inlIvEEibE1a_0
+
+ return a.field;
+ }
+ }
+
+ int call(bool b) { return inl<void>(b); }
+}