re PR c++/11415 (Error message with ::::)
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
Sat, 27 Sep 2003 16:34:28 +0000 (16:34 +0000)
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>
Sat, 27 Sep 2003 16:34:28 +0000 (16:34 +0000)
PR c++/11413
* parser.c (cp_parser_nested_name_specifier_opt): Issue correct
error message when parser->scope is global_namespace.

From-SVN: r71856

gcc/cp/ChangeLog
gcc/cp/parser.c

index cbf9b54c585f1461af4d101f285436c206ba3836..c897dac12d993e70914d8639cd516dada0b86a10 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-27  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>
+
+       PR c++/11413
+       * parser.c (cp_parser_nested_name_specifier_opt): Issue correct
+       error message when parser->scope is global_namespace.
+
 2003-09-27  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * cp-tree.h, name-lookup.h, decl.c, decl2.c: Remove reference to
index 776429096a8b476701dbf7c0c6108fdcfa8c850c..7968b28f92d46a4092d8e4ebc18918d3d080af11 100644 (file)
@@ -2997,6 +2997,10 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
                        error ("`%T::%D' is not a class-name or "
                               "namespace-name",
                               parser->scope, token->value);
+                     else if (parser->scope == global_namespace)
+                       error ("`::%D' is not a class-name or "
+                              "namespace-name",
+                              token->value);
                      else
                        error ("`%D::%D' is not a class-name or "
                               "namespace-name",