When we're parsing an expression that may have looked like a
declaration, we can end up with template-id annotation tokens for
types that have not been converted into type annotation tokens. When
this is the case, translate the template-id into a type and parse as
an expression.
llvm-svn: 95404
diff --git a/clang/test/SemaTemplate/template-id-expr.cpp b/clang/test/SemaTemplate/template-id-expr.cpp
index 70a1062..b3f41be 100644
--- a/clang/test/SemaTemplate/template-id-expr.cpp
+++ b/clang/test/SemaTemplate/template-id-expr.cpp
@@ -27,3 +27,20 @@
void test_X0_int(X0<int> xi, float f) {
xi.f2(f);
}
+
+// Not template-id expressions, but they almost look like it.
+template<typename F>
+struct Y {
+ Y(const F&);
+};
+
+template<int I>
+struct X {
+ X(int, int);
+ void f() {
+ Y<X<I> >(X<I>(0, 0));
+ Y<X<I> >(::X<I>(0, 0));
+ }
+};
+
+template struct X<3>;