Commit 0c83a0fc by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/9779 (ICE in type_unknown_p when casting in static member)

cp:
	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.
testsuite:
	PR c++/9779
	* g++.dg/template/dependent-expr1.C: New.

From-SVN: r68824
parent 1a8c4ca6
2003-07-02 Nathan Sidwell <nathan@codesourcery.com>
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.
2003-07-01 Mark Mitchell <mark@codesourcery.com>
PR c++/6949
......
......@@ -4057,6 +4057,11 @@ arg_assoc_class (struct arg_lookup *k, tree type)
static bool
arg_assoc_type (struct arg_lookup *k, tree type)
{
/* As we do not get the type of non-type dependent expressions
right, we can end up with such things without a type. */
if (!type)
return false;
switch (TREE_CODE (type))
{
case ERROR_MARK:
......
......@@ -183,7 +183,11 @@ type_unknown_p (exp)
return (TREE_CODE (exp) == OVERLOAD
|| TREE_CODE (exp) == TREE_LIST
|| TREE_TYPE (exp) == unknown_type_node
|| (TREE_CODE (TREE_TYPE (exp)) == OFFSET_TYPE
/* Until we get the type of non type-dependent expressions
correct, we can have non-type dependent expressions with
no type. */
|| (TREE_TYPE (exp)
&& TREE_CODE (TREE_TYPE (exp)) == OFFSET_TYPE
&& TREE_TYPE (TREE_TYPE (exp)) == unknown_type_node));
}
......
2003-07-02 Nathan Sidwell <nathan@codesourcery.com>
PR c++/9779
* g++.dg/template/dependent-expr1.C: New.
2003-07-01 Mark Mitchell <mark@codesourcery.com>
PR c++/6949
......
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 30 Jun 2003 <nathan@codesourcery.com>
// PR c++ 9779. ICE
struct I
{
};
void Foo (int);
namespace std
{
template <typename X>
void Baz (I *x)
{
Foo (sizeof (I));
Foo (sizeof (x));
Foo (__alignof__ (I));
Foo (__alignof__ (x));
Foo (x->~I ());
// Foo (typeid (I));
Foo (delete x);
Foo (delete[] x);
Foo (throw x);
}
}
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