aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2013-10-08 21:58:58 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-10-08 21:58:58 +0000
commitc80217c9fabc7bdcba6e098a4903a0d357333b8d (patch)
tree4023b4c69f0f5ea622a899f879c7cade5bafc152 /gcc/cp
parenta330ff7f5c68964b62c691649560ae2f19430a8f (diff)
downloadgcc-c80217c9fabc7bdcba6e098a4903a0d357333b8d.zip
gcc-c80217c9fabc7bdcba6e098a4903a0d357333b8d.tar.gz
gcc-c80217c9fabc7bdcba6e098a4903a0d357333b8d.tar.bz2
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
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl.c4
-rw-r--r--gcc/cp/lambda.c4
3 files changed, 11 insertions, 4 deletions
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 <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>
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;
}