diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-02 09:41:52 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-02 09:41:52 +0000 |
commit | 2f0497a7ddb2540f73a27e9bc7d1e2cef5f1a949 (patch) | |
tree | 56759051b94c423606105424911547d55c95409b /gcc | |
parent | e4dd7d1a6fde4f6292fb4c47c34dd4e9b787dfa5 (diff) | |
download | gcc-2f0497a7ddb2540f73a27e9bc7d1e2cef5f1a949.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68825 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/cp/tree.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/error1.C | 13 |
5 files changed, 25 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c8bb8930c70..97083044c2b 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 43fc5ab0860..607bdd11809 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 385afcac4c9..6c6d9b94839 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 1a4d547818b..7f3678cfa21 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 00000000000..c23e33c1281 --- /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" "" } +} |