Commit 08476342 by Nathan Sidwell Committed by Nathan Sidwell

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
parent 0c83a0fc
2003-07-02 Nathan Sidwell <nathan@codesourcery.com> 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 PR c++/9779
* decl2.c (arg_assoc_class): Don't die on NULL type. * decl2.c (arg_assoc_class): Don't die on NULL type.
* typeck.c (type_unknown_p): Don't die on untyped expressions. * typeck.c (type_unknown_p): Don't die on untyped expressions.
......
...@@ -8830,6 +8830,8 @@ type_unification_real (tree tparms, ...@@ -8830,6 +8830,8 @@ type_unification_real (tree tparms,
continue; continue;
} }
arg = TREE_TYPE (arg); arg = TREE_TYPE (arg);
if (arg == error_mark_node)
return 1;
} }
{ {
......
...@@ -1747,8 +1747,11 @@ tree ...@@ -1747,8 +1747,11 @@ tree
error_type (tree arg) error_type (tree arg)
{ {
tree type = TREE_TYPE (arg); tree type = TREE_TYPE (arg);
if (TREE_CODE (type) == ARRAY_TYPE) if (TREE_CODE (type) == ARRAY_TYPE)
; ;
else if (TREE_CODE (type) == ERROR_MARK)
;
else if (real_lvalue_p (arg)) else if (real_lvalue_p (arg))
type = build_reference_type (lvalue_type (arg)); type = build_reference_type (lvalue_type (arg));
else if (IS_AGGR_TYPE (type)) else if (IS_AGGR_TYPE (type))
......
2003-07-02 Nathan Sidwell <nathan@codesourcery.com> 2003-07-02 Nathan Sidwell <nathan@codesourcery.com>
PR c++/10219
* g++.dg/template/error1.C: New.
PR c++/9779 PR c++/9779
* g++.dg/template/dependent-expr1.C: New. * g++.dg/template/dependent-expr1.C: New.
......
// { 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" "" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment