OSDN Git Service

cp:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Mar 2003 18:20:12 +0000 (18:20 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Mar 2003 18:20:12 +0000 (18:20 +0000)
PR c++/10026
* decl2.c (arg_assoc_type) [ERROR_MARK]: Don't die.
testsuite:
PR c++/10026
* g++.dg/lookup/koenig1.C: New test.

PR C++/10199
* g++.dg/lookup/template2.C: New test.

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

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

index 68c1716..5ffb144 100644 (file)
@@ -1,7 +1,13 @@
+2003-03-24  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/10026
+       * decl2.c (arg_assoc_type) [ERROR_MARK]: Don't die.
+
 2003-03-23  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/7086
-       * typeck.c (cxx_mark_addressable): Likewise.
+       * typeck.c (cxx_mark_addressable):  Adjust call to
+       gen_mem_addressof or put_var_into_stack.
 
 2003-03-22  Nathan Sidwell  <nathan@codesourcery.com>
 
 
 2003-02-26  Devang Patel  <dpatel@apple.com>
 
-       * decl.c (finish_enum): Merge two 'for' loops. Copy value node if required.
-       Postpone enum setting for template decls.
-       (build_enumerator): Delay copying value node until finish_enum (). Remove
-       #if 0'ed code.
+       * decl.c (finish_enum): Merge two 'for' loops. Copy value node if
+       required.  Postpone enum setting for template decls.
+       (build_enumerator): Delay copying value node until finish_enum
+       (). Remove #if 0'ed code.
        * pt.c (tsubst_enum): Set TREE_TYPE and copy value node.
        (tsubst_copy): Add check for enum type.
 
index 751d0f6..9f5e27e 100644 (file)
@@ -3986,6 +3986,8 @@ arg_assoc_type (struct arg_lookup *k, tree type)
 {
   switch (TREE_CODE (type))
     {
+    case ERROR_MARK:
+      return false;
     case VOID_TYPE:
     case INTEGER_TYPE:
     case REAL_TYPE:
index 25027a9..a402ba0 100644 (file)
@@ -1,3 +1,11 @@
+2003-03-24  Nathan Sidwell  <nathan@codesourcery.com>
+
+       PR c++/10026
+       * g++.dg/lookup/koenig1.C: New test.
+
+       PR C++/10199
+       * g++.dg/lookup/template2.C: New test.
+
 2003-03-24  Jakub Jelinek  <jakub@redhat.com>
 
        * g++.dg/opt/rtti1.C: New test.
diff --git a/gcc/testsuite/g++.dg/lookup/koenig1.C b/gcc/testsuite/g++.dg/lookup/koenig1.C
new file mode 100644 (file)
index 0000000..697a322
--- /dev/null
@@ -0,0 +1,13 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Mar 2003 <nathan@codesourcery.com>
+
+// PR 10026. We ICE'd
+
+class X;
+
+void foo() {
+  X x(1); // { dg-error "incomplete type" "" }
+  bar(x); // { dg-error "undeclared" "" }
+}
diff --git a/gcc/testsuite/g++.dg/lookup/template2.C b/gcc/testsuite/g++.dg/lookup/template2.C
new file mode 100644 (file)
index 0000000..0e89212
--- /dev/null
@@ -0,0 +1,31 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 24 Mar 2003 <nathan@codesourcery.com>
+
+// PR 10199. Lookup problems
+
+class X {
+public:
+  template<int d>
+  int bar ();
+};
+
+template<int x>
+int fooo ();
+
+template<class T>
+void bar (T& g)
+{
+  int kk = fooo<17>();  // OK
+  X x;
+  int k = x.bar<17>();  // Not OK
+}
+
+int main ()
+{
+  X x;
+  int k=x.bar<17>();    // OK
+  int n;
+  bar(n);
+}