aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@adacore.com>2013-01-08 12:34:12 +0000
committerJoel Brobecker <brobecke@gcc.gnu.org>2013-01-08 12:34:12 +0000
commit80a8d5212e6f3841c5c20a04f3b479d4fb6f9b9d (patch)
tree60d2d716e06ed5f3c27067fa8d4500b236dd2985
parent0985d1f526c9bf3ce0e82a3d20eb7814db39a031 (diff)
downloadgcc-80a8d5212e6f3841c5c20a04f3b479d4fb6f9b9d.zip
gcc-80a8d5212e6f3841c5c20a04f3b479d4fb6f9b9d.tar.gz
gcc-80a8d5212e6f3841c5c20a04f3b479d4fb6f9b9d.tar.bz2
statement before variable declaration in cp_parser_initializer_list.
gcc/cp/ChangeLog: * parser.c (cp_parser_initializer_list): Move declaration of variable non_const to start of lexical block. From-SVN: r195013
-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);