]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/20679 (Parse error when accessing attributes of an inner class. Enclosing...
authorMark Mitchell <mark@codesourcery.com>
Mon, 4 Apr 2005 23:43:54 +0000 (23:43 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Mon, 4 Apr 2005 23:43:54 +0000 (23:43 +0000)
PR c++/20679
* parser.c (cp_parser_template_name): Fix thinko.

PR c++/20679
* g++.dg/template/overload4.C: New test.

From-SVN: r97584

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

index 843a07b8233876c101eb0098ad4e88b4e021cea0..9a1876d68da66e8b0f907b029b6dae6db29f7e8e 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-04  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/20679
+       * parser.c (cp_parser_template_name): Fix thinko.
+
 2005-04-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        PR c++/18644
index d720d0f6e05ce0cf2c20866d9496258f6e5b1111..fb0d1e3051304405e393cbadc43afe77bfbb60cf 100644 (file)
@@ -8231,6 +8231,8 @@ cp_parser_template_name (cp_parser* parser,
     ;
   else 
     {
+      tree fn = NULL_TREE;
+
       /* The standard does not explicitly indicate whether a name that
         names a set of overloaded declarations, some of which are
         templates, is a template-name.  However, such a name should
@@ -8238,14 +8240,11 @@ cp_parser_template_name (cp_parser* parser,
         template-id for the overloaded templates.  */
       fns = BASELINK_P (decl) ? BASELINK_FUNCTIONS (decl) : decl;
       if (TREE_CODE (fns) == OVERLOAD)
-       {
-         tree fn;
-         
-         for (fn = fns; fn; fn = OVL_NEXT (fn))
-           if (TREE_CODE (OVL_CURRENT (fn)) == TEMPLATE_DECL)
-             break;
-       }
-      else
+       for (fn = fns; fn; fn = OVL_NEXT (fn))
+         if (TREE_CODE (OVL_CURRENT (fn)) == TEMPLATE_DECL)
+           break;
+
+      if (!fn)
        {
          /* Otherwise, the name does not name a template.  */
          cp_parser_error (parser, "expected template-name");
index e85012d7d582fad4af636756ec59a7e38bf7259d..3f265edc037d2e9106ea5f0a62810a0c62e7910c 100644 (file)
@@ -1,3 +1,8 @@
+2005-04-04  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/20679
+       * g++.dg/template/overload4.C: New test.
+
 2005-04-03  Gabriel Dos Reis  <gdr@integrable-solutions.net>
         
        PR c++/18644