OSDN Git Service

PR c++/1255
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jun 2003 22:24:58 +0000 (22:24 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 17 Jun 2003 22:24:58 +0000 (22:24 +0000)
* class.c (handle_using_decl): Robustify.

PR c++/1255
* g++.dg/lookup/using3.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68118 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lookup/using7.C [new file with mode: 0644]

index a3585fc..cf67ace 100644 (file)
@@ -1,5 +1,8 @@
 2003-06-17  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/1255
+       * class.c (handle_using_decl): Robustify.
+
        PR c++/11105
        * cp-tree.h (DECL_CONV_FN_TYPE): New method.
        * mangle.c (struct globals): Remove internal_mangling_p.
index c4887f1..53f097b 100644 (file)
@@ -1108,6 +1108,9 @@ handle_using_decl (tree using_decl, tree t)
   tree flist = NULL_TREE;
   tree old_value;
 
+  if (ctype == error_mark_node)
+    return;
+
   binfo = lookup_base (t, ctype, ba_any, NULL);
   if (! binfo)
     {
index 9c1fcd2..ef46313 100644 (file)
@@ -1,5 +1,10 @@
 2003-06-17  Mark Mitchell  <mark@codesourcery.com>
 
+       PR c++/1255
+       * g++.dg/lookup/using7.C: New test.
+       
+2003-06-17  Mark Mitchell  <mark@codesourcery.com>
+
        PR c++/11105
        * g++.dg/abi/conv1.C: Remove it.
        * g++.dg/template/conv7.C: New test.
diff --git a/gcc/testsuite/g++.dg/lookup/using7.C b/gcc/testsuite/g++.dg/lookup/using7.C
new file mode 100644 (file)
index 0000000..5f187fe
--- /dev/null
@@ -0,0 +1,11 @@
+template <typename T, bool=T::X> struct A
+{
+  int i;
+};
+
+template <typename T> struct B : A<T>
+{
+  using A<T>::i; // { dg-error "" } 
+};
+
+B<void> b; // { dg-error "" }