aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 74ed223..49e924d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2013-01-08 Joel Brobecker <brobecker@adacore.com>
+
+ * parser.c (cp_parser_initializer_list): Move declaration
+ of variable non_const to start of lexical block.
+
2013-01-07 Jason Merrill <jason@redhat.com>
PR c++/55753
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 872d419..8a90bec 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -17930,9 +17930,10 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p)
&& cp_lexer_next_token_is (parser->lexer, CPP_OPEN_SQUARE))
{
/* In C++11, [ could start a lambda-introducer. */
+ bool non_const = false;
+
cp_parser_parse_tentatively (parser);
cp_lexer_consume_token (parser->lexer);
- bool non_const = false;
designator = cp_parser_constant_expression (parser, true, &non_const);
cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE);
cp_parser_require (parser, CPP_EQ, RT_EQ);