re PR c++/11871 (Koenig lookup regression)

cp:
	PR c++/11871
	* decl.c (push_class_level_binding): Correct old_decl value from
	my 2003-07-29 reorganization.
testsuite:
	PR c++/11871
	* c++.dg/lookup/crash1.C: New test.

From-SVN: r70803
This commit is contained in:
Nathan Sidwell 2003-08-26 09:16:16 +00:00 committed by Nathan Sidwell
parent 20b506726b
commit 6d9a0a36e5
4 changed files with 41 additions and 1 deletions

View File

@ -1,5 +1,9 @@
2003-08-26 Nathan Sidwell <nathan@codesourcery.com>
PR c++/11871
* decl.c (push_class_level_binding): Correct old_decl value from
my 2003-07-29 reorganization.
* call.c (build_call): Don't set TREE_SIDE_EFFECTS here.
(build_new_method_call): Add goto finish.
* semantics.c (simplify_aggr_init_exprs_r): Don't set

View File

@ -4282,11 +4282,13 @@ push_class_level_binding (tree name, tree x)
if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval)
&& !(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x)))
{
old_decl = BINDING_TYPE (binding);
BINDING_TYPE (binding) = bval;
BINDING_VALUE (binding) = NULL_TREE;
INHERITED_VALUE_BINDING_P (binding) = 0;
}
old_decl = bval;
else
old_decl = bval;
}
else if (TREE_CODE (x) == OVERLOAD && is_overloaded_fn (bval))
old_decl = bval;

View File

@ -1,5 +1,8 @@
2003-08-26 Nathan Sidwell <nathan@codesourcery.com>
PR c++/11871
* c++.dg/lookup/crash1.C: New test.
* c++.dg/warn/noeffect3.C: New test.
2003-08-25 Janis Johnson <janis187@us.ibm.com>

View File

@ -0,0 +1,31 @@
// { dg-do compile }
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 25 Aug 2003 <nathan@codesourcery.com>
// Origin pr 11871 Dirk Mueller <mueller@kde.org>
// PR c++/11871 Regression
namespace std
{
class A
{
public:
enum result
{
ok
};
};
template<typename T> class B : public A
{
public:
typedef A::result result;
};
}
int main()
{
for(float result = 1.0;;);
}