the reference-ness of the parameter's type.
ExprResult SubstReplacement = TransformExpr(E->getReplacement());
if (SubstReplacement.isInvalid())
return true;
- QualType SubstType = TransformType(E->getType());
+ QualType SubstType = TransformType(E->getParameterType(getSema().Context));
if (SubstType.isNull())
return true;
// The type may have been previously dependent and not now, which means we
void use() { f<X1>(); }
}
+
+namespace ReferenceToConstexpr {
+ struct A { const char *str = "hello"; };
+ constexpr A a;
+ template<const A &r, typename T> struct B {
+ static_assert(__builtin_strcmp(r.str, "hello") == 0, "");
+ };
+ template<const A &r> struct C {
+ template<typename T> void f(B<r, T>, T) {}
+ };
+ void f(C<a> ca) { ca.f({}, 0); }
+}