diff options
author | Jason Merrill <jason@redhat.com> | 2008-12-18 10:54:59 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2008-12-18 10:54:59 -0500 |
commit | a11669269b8db37bbaeba380c3cfc8b21984d8e0 (patch) | |
tree | bc102fc909a88decdd7ab17b98804630c66d3206 | |
parent | 938e76ad6da1c4a3a95c213a91094231491a7ee9 (diff) | |
download | gcc-a11669269b8db37bbaeba380c3cfc8b21984d8e0.zip gcc-a11669269b8db37bbaeba380c3cfc8b21984d8e0.tar.gz gcc-a11669269b8db37bbaeba380c3cfc8b21984d8e0.tar.bz2 |
re PR c++/38485 (GCC can't parse a parenthesized comma in a template-id within a default argument)
PR c++/38485
* parser.c (cp_parser_token_starts_cast_expression): An EOF
can't start a cast-expression.
From-SVN: r142815
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/parse/defarg13.C | 8 |
4 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2c681c0..00415ec 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-12-18 Jason Merrill <jason@redhat.com> + + PR c++/38485 + * parser.c (cp_parser_token_starts_cast_expression): An EOF + can't start a cast-expression. + 2008-12-17 Jason Merrill <jason@redhat.com> * semantics.c (describable_type): New function. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 79be488..400f36c 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -5953,6 +5953,7 @@ cp_parser_token_starts_cast_expression (cp_token *token) case CPP_XOR: case CPP_OR: case CPP_OR_OR: + case CPP_EOF: return false; /* '[' may start a primary-expression in obj-c++. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8306303..4756cd1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-12-18 Jason Merrill <jason@redhat.com> + + PR c++/38485 + * g++.dg/parse/defarg13.C: New test. + 2008-12-18 Kenneth Zadeck <zadeck@naturalbridge.com> PR rtl-optimization/37922 diff --git a/gcc/testsuite/g++.dg/parse/defarg13.C b/gcc/testsuite/g++.dg/parse/defarg13.C new file mode 100644 index 0000000..27c6db5 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/defarg13.C @@ -0,0 +1,8 @@ +// PR c++/38485 + +template <class Key, class T> +class QMap { }; + +class XMLConfigurations { + void translateToOther(QMap<int, int> match = (QMap<int, int>())); +}; |