to mark the constructor as referenced. Fixes the narrow issue reported
in PR6424, but there are a few other places that I'll fix before
closing out that PR.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97185
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!getDerived().AlwaysRebuild() &&
T == E->getType() &&
Constructor == E->getConstructor() &&
- !ArgumentChanged)
+ !ArgumentChanged) {
+ SemaRef.MarkDeclarationReferenced(E->getLocStart(), Constructor);
return SemaRef.Owned(E->Retain());
+ }
return getDerived().RebuildCXXConstructExpr(T, /*FIXME:*/E->getLocStart(),
Constructor, E->isElidable(),
int b;
test_asm(b); // expected-note {{in instantiation of function template specialization 'test_asm<int>' requested here}}
}
+
+namespace PR6424 {
+ template<int I> struct X {
+ X() {
+ int *ip = I; // expected-error{{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}}
+ }
+ };
+
+ template<int> struct Y {
+ typedef X<7> X7;
+
+ void f() { X7(); } // expected-note{{instantiation}}
+ };
+
+ template void Y<3>::f();
+}