]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/21151 (ICE when compiling c++ PCH of class definition within template funct...
authorNathan Sidwell <nathan@codesourcery.com>
Thu, 2 Jun 2005 08:53:48 +0000 (08:53 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 2 Jun 2005 08:53:48 +0000 (08:53 +0000)
cp:
PR c++/21151
* name-lookup.c (pushtag): Push local class even in a template.
testsuite:
PR c++/21151
* g++.dg/pch/local-1.C: New.
* g++.dg/pch/local-1.Hs: New.

From-SVN: r100482

gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/pch/local-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/pch/local-1.Hs [new file with mode: 0644]

index 36f72dfc998b9f13c2644a0b622569fcb76c608b..884d3461987841180767f8907fb56b7fd6685afd 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-02  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/21151
+       * name-lookup.c (pushtag): Push local class even in a template.
+
 2005-05-31  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/21165
index dde4227f790e83dc0c21116f3270dd6af6f528d8..3197a41077d8169111983d7fc6fca3685309146c 100644 (file)
@@ -4698,8 +4698,7 @@ pushtag (tree name, tree type, tag_scope scope)
             way.  (It's otherwise tricky to find a member function definition
             it's only pointed to from within a local class.)  */
          if (TYPE_CONTEXT (type)
-             && TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL
-             && !processing_template_decl)
+             && TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL)
            VEC_safe_push (tree, gc, local_classes, type);
         }
       if (b->kind == sk_class
index 288242eed45b6485df9273c7b1d8b4d121d78e35..07ab9b92412d743518973edf0a6bd601cedd2e2c 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-02  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/21151
+       * g++.dg/pch/local-1.C: New.
+       * g++.dg/pch/local-1.Hs: New.
+
 2005-06-01  Diego Novillo  <dnovillo@redhat.com>
 
        PR 14341, PR 21332, PR 20701, PR 21086, PR 21090
diff --git a/gcc/testsuite/g++.dg/pch/local-1.C b/gcc/testsuite/g++.dg/pch/local-1.C
new file mode 100644 (file)
index 0000000..75847e5
--- /dev/null
@@ -0,0 +1,6 @@
+#include "local-1.H"
+int main() 
+{
+  func<int> ();
+  return 0;
+}
diff --git a/gcc/testsuite/g++.dg/pch/local-1.Hs b/gcc/testsuite/g++.dg/pch/local-1.Hs
new file mode 100644 (file)
index 0000000..56a6c7e
--- /dev/null
@@ -0,0 +1,7 @@
+template<typename T> void func()   
+{   
+  struct object   
+  {   
+    object() {}
+  };   
+}