* typeck2.c (cxx_incomplete_type_diagnostic): Handle DECLTYPE_TYPE.
From-SVN: r238393
2016-07-15 Jason Merrill <jason@redhat.com>
+ PR c++/71511
+ * typeck2.c (cxx_incomplete_type_diagnostic): Handle DECLTYPE_TYPE.
+
PR c++/71513
* pt.c (tsubst_attributes): Fix loop logic.
break;
case TYPENAME_TYPE:
+ case DECLTYPE_TYPE:
emit_diagnostic (diag_kind, loc, 0,
"invalid use of dependent type %qT", type);
break;
--- /dev/null
+// PR c++/71511
+// { dg-do compile { target c++11 } }
+
+template < typename T >
+class A
+{
+ static int i;
+};
+
+//okay: template < typename T > int A <T>::i = 100;
+template < typename T > int decltype (A < T > ())::i = 100; // { dg-error "decltype" }