From c80217c9fabc7bdcba6e098a4903a0d357333b8d Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 8 Oct 2013 21:58:58 +0000 Subject: re PR c++/58568 ([c++11] ICE with lambda in invalid template variable definition) /cp 2013-10-08 Paolo Carlini 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 PR c++/58568 * g++.dg/cpp0x/lambda/lambda-ice10.C: New. * g++.old-deja/g++.mike/misc9.C: Adjust. From-SVN: r203289 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/decl.c | 4 ++-- gcc/cp/lambda.c | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3e68712..70dab1e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,12 @@ 2013-10-08 Paolo Carlini + 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 + PR c++/58665 Revert: 2013-10-04 Paolo Carlini diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 81ed409..5f17a05 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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; } } diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 2ffa7e0..2ecb17c 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -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; } -- cgit v1.1