if (!ND)
return SemaRef.ExprError();
- DeclarationNameInfo NameInfo
- = getDerived().TransformDeclarationNameInfo(E->getNameInfo());
- if (!NameInfo.getName())
- return SemaRef.ExprError();
+ DeclarationNameInfo NameInfo = E->getNameInfo();
+ if (NameInfo.getName()) {
+ NameInfo = getDerived().TransformDeclarationNameInfo(NameInfo);
+ if (!NameInfo.getName())
+ return SemaRef.ExprError();
+ }
if (!getDerived().AlwaysRebuild() &&
Qualifier == E->getQualifier() &&
};
void g() { X<2>(); }
}
+
+// <rdar://problem/8302161>
+namespace test1 {
+ template <typename T> void f(T const &t) {
+ union { char c; T t_; };
+ c = 'a'; // <- this shouldn't silently fail to instantiate
+ T::foo(); // expected-error {{has no members}}
+ }
+ template void f(int const &); // expected-note {{requested here}}
+}