diff options
-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 2c681c0edbc..00415ecb92d 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 79be488028f..400f36cc290 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 83063037de9..4756cd1792e 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 00000000000..27c6db50aad --- /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>())); +}; |