re PR c++/39859 (duplicated and unhelpful error for "c:n" (parser))
authorNathan Froyd <froydnj@codesourcery.com>
Thu, 16 Dec 2010 01:36:09 +0000 (01:36 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Thu, 16 Dec 2010 01:36:09 +0000 (01:36 +0000)
commit782d1c333f42c650699be7f7f4679c38ab544ecd
tree3ab2ddf89eac92b4a61685e2d4c4770e8b840c97
parentb2d49fe5aa6529689c71df4a0635041725cb94d1
re PR c++/39859 (duplicated and unhelpful error for "c:n" (parser))

gcc/cp/
PR c++/39859
PR c++/44522
PR c++/44523
* parser.c (struct cp_parser): Add colon_corrects_to_scope_p field.
(cp_parser_new): Initialize it.
(cp_parser_nested_name_specifier_opt): Auto-correct colons to
scopes if we are able to.
(cp_parser_question_colon_clause): Disallow colon correction.
(cp_parser_label_for_labeled_statement): Likewise.
(cp_parser_range_for): Likewise.
(cp_parser_enum_specifier): Likewise.
(cp_parser_class_head): Likewise.
(cp_parser_member_declaration): Likewise.

gcc/testsuite/
PR c++/39859
PR c++/44522
PR c++/44523
* g++.dg/parse/colon-autocorrect-1.C: New testcase.
* g++.dg/parse/colon-autocorrect-2.C: New testcase.

From-SVN: r167895
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/colon-autocorrect-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/colon-autocorrect-2.C [new file with mode: 0644]