aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo@gcc.gnu.org>2007-08-31 09:11:43 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2007-08-31 09:11:43 +0000
commita53bf42c31fe143b6f3079154a772ea1c8b921b0 (patch)
treef93427a75147858d4e3281b56ca249a51e316ffa /gcc/cp/parser.c
parent22d2aa96f8da11d7710962b298a8036e0fe44720 (diff)
downloadgcc-a53bf42c31fe143b6f3079154a772ea1c8b921b0.zip
gcc-a53bf42c31fe143b6f3079154a772ea1c8b921b0.tar.gz
gcc-a53bf42c31fe143b6f3079154a772ea1c8b921b0.tar.bz2
re PR c++/33212 (Broken diagnostic: 'trait_expr' not supported by dump_expr)
/cp 2007-08-31 Paolo Carlini <pcarlini@suse.de> PR c++/33212 * parser.c (cp_parser_trait_expr): Check rerurn value of cp_parser_type_id. /testsuite 2007-08-31 Paolo Carlini <pcarlini@suse.de> PR c++/33212 * g++.dg/ext/is_class_error.C: New. From-SVN: r127962
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 70006c9..92f4430 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -6502,6 +6502,9 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
type1 = cp_parser_type_id (parser);
+ if (type1 == error_mark_node)
+ return error_mark_node;
+
/* Build a trivial decl-specifier-seq. */
clear_decl_specs (&decl_specs);
decl_specs.type = type1;
@@ -6516,6 +6519,9 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
type2 = cp_parser_type_id (parser);
+ if (type2 == error_mark_node)
+ return error_mark_node;
+
/* Build a trivial decl-specifier-seq. */
clear_decl_specs (&decl_specs);
decl_specs.type = type2;
@@ -6527,8 +6533,8 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
- /* Complete the trait expr, which may mean either processing the
- static assert now or saving it for template instantiation. */
+ /* Complete the trait expression, which may mean either processing
+ the trait expr now or saving it for template instantiation. */
return finish_trait_expr (kind, type1, type2);
}