aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-07-02 09:41:52 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2003-07-02 09:41:52 +0000
commit08476342abb92b3fa8960a9c7b2036a596791af2 (patch)
tree56759051b94c423606105424911547d55c95409b /gcc
parent0c83a0fcff9df31e594bcf7d888c7842b940b003 (diff)
downloadgcc-08476342abb92b3fa8960a9c7b2036a596791af2.zip
gcc-08476342abb92b3fa8960a9c7b2036a596791af2.tar.gz
gcc-08476342abb92b3fa8960a9c7b2036a596791af2.tar.bz2
re PR c++/10219 (ICE in maybe_adjust_types_for_deduction on invalid code)
cp: PR c++/10219 * pt.c (type_unification_real): Don't unify exprs of error type. * tree.c (error_type): Don't die on error_type. testsuite: PR c++/10219 * g++.dg/template/error1.C: New. From-SVN: r68825
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/cp/tree.c3
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/template/error1.C13
5 files changed, 25 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c8bb893..9708304 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2003-07-02 Nathan Sidwell <nathan@codesourcery.com>
+ PR c++/10219
+ * pt.c (type_unification_real): Don't unify exprs of error type.
+ * tree.c (error_type): Don't die on error_type.
+
PR c++/9779
* decl2.c (arg_assoc_class): Don't die on NULL type.
* typeck.c (type_unknown_p): Don't die on untyped expressions.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 43fc5ab..607bdd1 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -8830,6 +8830,8 @@ type_unification_real (tree tparms,
continue;
}
arg = TREE_TYPE (arg);
+ if (arg == error_mark_node)
+ return 1;
}
{
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 385afca..6c6d9b9 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -1747,8 +1747,11 @@ tree
error_type (tree arg)
{
tree type = TREE_TYPE (arg);
+
if (TREE_CODE (type) == ARRAY_TYPE)
;
+ else if (TREE_CODE (type) == ERROR_MARK)
+ ;
else if (real_lvalue_p (arg))
type = build_reference_type (lvalue_type (arg));
else if (IS_AGGR_TYPE (type))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1a4d547..7f3678c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2003-07-02 Nathan Sidwell <nathan@codesourcery.com>
+ PR c++/10219
+ * g++.dg/template/error1.C: New.
+
PR c++/9779
* g++.dg/template/dependent-expr1.C: New.
diff --git a/gcc/testsuite/g++.dg/template/error1.C b/gcc/testsuite/g++.dg/template/error1.C
new file mode 100644
index 0000000..c23e33c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error1.C
@@ -0,0 +1,13 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Jun 2003 <nathan@codesourcery.com>
+
+// PR c++ 10219. ICE
+
+template <class T> void make_pair(T x);
+
+void foo(){
+ struct fps_chan_ID fps; // { dg-error "incomplete" "" }
+ make_pair(fps); // { dg-error "no matching function" "" }
+}