Commit 2a54351b by Jason Merrill Committed by Jason Merrill

PR c++/71511 - ICE on decltype scope in declaration.

	* typeck2.c (cxx_incomplete_type_diagnostic): Handle DECLTYPE_TYPE.

From-SVN: r238393
parent 1019d191
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.
......
......@@ -537,6 +537,7 @@ cxx_incomplete_type_diagnostic (location_t loc, const_tree value,
break;
case TYPENAME_TYPE:
case DECLTYPE_TYPE:
emit_diagnostic (diag_kind, loc, 0,
"invalid use of dependent type %qT", type);
break;
......
// 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" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment