Commit 1a32490a by Alexandre Oliva Committed by Alexandre Oliva

re PR c++/21087 (ICE in do_nonmember_using_decl)

gcc/cp/ChangeLog:
PR c++/21087
* name-lookup.c (push_overloaded_decl): Do not overload with
non-duplicate anticipated built-in.
gcc/testsuite/ChangeLog:
PR c++/21087
* g++.dg/lookup/builtin2.C: New test.

From-SVN: r98570
parent 1751a45f
2005-04-22 Alexandre Oliva <aoliva@redhat.com>
PR c++/21087
* name-lookup.c (push_overloaded_decl): Do not overload with
non-duplicate anticipated built-in.
2005-04-21 Kazu Hirata <kazu@cs.umass.edu>
* cp-tree.h (THROW_NAME, AUTO_VTABLE_NAME, AUTO_TEMP_FORMAT,
......
......@@ -1883,6 +1883,13 @@ push_overloaded_decl (tree decl, int flags)
if (duplicate_decls (decl, fn) == fn)
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, fn);
}
/* We don't overload implicit built-ins. duplicate_decls()
may fail to merge the decls if the new decl is e.g. a
template function. */
if (TREE_CODE (old) == FUNCTION_DECL
&& DECL_ANTICIPATED (old))
old = NULL;
}
else if (old == error_mark_node)
/* Ignore the undefined symbol marker. */
......
2005-04-22 Alexandre Oliva <aoliva@redhat.com>
PR c++/21087
* g++.dg/lookup/builtin2.C: New test.
2005-04-22 Joseph S. Myers <joseph@codesourcery.com>
* gcc.dg/weak/weak-13.c: New test.
......
/* { dg-do compile } */
/* PR c++/21087 */
/* We used to overload the template function with the built-in
declaration, instead of replacing it as we should, and then barf at
the using decl because of a test that none of the overload set
members were anticipated built-ins. */
extern "C" signed int toupper(signed int __c) throw();
namespace std
{
template< typename a > a toupper(a,int){}
using ::toupper;
}
int f () {
std::toupper((signed int)'a');
}
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