re PR c++/23044 (ICE on valid code)
authorNathan Sidwell <nathan@codesourcery.com>
Tue, 23 Aug 2005 12:35:42 +0000 (12:35 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Tue, 23 Aug 2005 12:35:42 +0000 (12:35 +0000)
cp:
PR c++/23044
* pt.c (tsubst_qualified_id): A SCOPE_REF can still remain.
testsuite:
PR c++/23044
* g++.dg/template/instantiate8.C: New.

From-SVN: r103395

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/instantiate8.C [new file with mode: 0644]

index 25c0610c5d0627e14741d3479fcd48c465f30b03..305cf5179c2c4a60c1961b307dbd02d4014c270a 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-23  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/23044
+       * pt.c (tsubst_qualified_id): A SCOPE_REF can still remain.
+
 2005-08-22  James E Wilson  <wilson@specifix.com>
 
        PR tree-optimization/23426
index f217198faa26108ea97f88ef49d8fd4b4363d7c1..71ac318919350d4c9547b2b52d536af146478728 100644 (file)
@@ -7680,7 +7680,8 @@ tsubst_qualified_id (tree qualified_id, tree args,
       expr = finish_qualified_id_expr (scope, expr, done, address_p);
     }
 
-  expr = convert_from_reference (expr);
+  if (TREE_CODE (expr) != SCOPE_REF)
+    expr = convert_from_reference (expr);
 
   return expr;
 }
index fe03c798c453c165e709e620bcb0034ae45766b6..b37317b4e51cea5891baaed3e6c12fe461dc77db 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-23  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/23044
+       * g++.dg/template/instantiate8.C: New.
+
 2005-08-23  J"orn Rennecke <joern.rennecke@st.com>
 
        PR middle-end/23467
diff --git a/gcc/testsuite/g++.dg/template/instantiate8.C b/gcc/testsuite/g++.dg/template/instantiate8.C
new file mode 100644 (file)
index 0000000..9004a86
--- /dev/null
@@ -0,0 +1,17 @@
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 18 Aug 2005 <nathan@codesourcery.com>
+
+// PR 22044: ICE
+// Origin: Andrew Pinski <pinskia@gcc.gnu.org>
+
+struct no_context {
+  template< class Event > void no_function( const Event & );
+};
+template< class Event, class TransitionContext = no_context,
+void ( TransitionContext::*pTransitionAction )( const Event & ) = &no_context::no_function< Event > >
+struct transition
+{
+  struct EvFlipBit {};
+  typedef transition<EvFlipBit> type;
+};
+