Commit c80217c9 by Paolo Carlini Committed by Paolo Carlini

re PR c++/58568 ([c++11] ICE with lambda in invalid template variable definition)

/cp
2013-10-08  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58568
	* lambda.c (begin_lambda_type): Check return value of xref_tag
	for error_mark_node; tidy.
	* decl.c (grokdeclarator): Tweak error message.

/testsuite
2013-10-08  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58568
	* g++.dg/cpp0x/lambda/lambda-ice10.C: New.
	* g++.old-deja/g++.mike/misc9.C: Adjust.

From-SVN: r203289
parent a330ff7f
2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58568
* lambda.c (begin_lambda_type): Check return value of xref_tag
for error_mark_node; tidy.
* decl.c (grokdeclarator): Tweak error message.
2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58665
Revert:
2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
......
......@@ -8774,8 +8774,8 @@ grokdeclarator (const cp_declarator *declarator,
&& !uniquely_derived_from_p (ctype,
current_class_type))
{
error ("type %qT is not derived from type %qT",
ctype, current_class_type);
error ("invalid use of qualified-name %<%T::%D%>",
qualifying_scope, decl);
return error_mark_node;
}
}
......
......@@ -138,6 +138,8 @@ begin_lambda_type (tree lambda)
name,
/*scope=*/ts_lambda,
/*template_header_p=*/false);
if (type == error_mark_node)
return error_mark_node;
}
/* Designate it as a struct so that we can use aggregate initialization. */
......@@ -152,8 +154,6 @@ begin_lambda_type (tree lambda)
/* Start the class. */
type = begin_class_definition (type);
if (type == error_mark_node)
return error_mark_node;
return type;
}
......
2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58568
* g++.dg/cpp0x/lambda/lambda-ice10.C: New.
* g++.old-deja/g++.mike/misc9.C: Adjust.
2013-10-08 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58665
Revert:
2013-10-04 Paolo Carlini <paolo.carlini@oracle.com>
......
// PR c++/58568
// { dg-do compile { target c++11 } }
template<int> struct A
{
static const int i;
template<int N> const int A<N>::i = []{ return 0; }(); // { dg-error "invalid use" }
};
......@@ -8,6 +8,6 @@ class bee {
class foo {
public:
int bee::bar; // { dg-error "not derived" } you cannot do this
int bee::bar; // { dg-error "invalid use" } you cannot do this
int me();
};
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