mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-24 23:56:05 +08:00
re PR c++/34691 (Default argument checking not performed after overload resolution with C linkage)
PR c++/34691 * name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched extern C declarations. * libsupc++/unwind-cxx.h: Correct __cxa_call_terminate prototype. From-SVN: r145386
This commit is contained in:
parent
9daa490df6
commit
a70f5987c4
@ -1,5 +1,9 @@
|
|||||||
2009-03-31 Jason Merrill <jason@redhat.com>
|
2009-03-31 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/34691
|
||||||
|
* name-lookup.c (pushdecl_maybe_friend): Diagnose mismatched
|
||||||
|
extern "C" declarations.
|
||||||
|
|
||||||
C++ DR 613
|
C++ DR 613
|
||||||
* semantics.c (finish_non_static_data_member): Allow such references
|
* semantics.c (finish_non_static_data_member): Allow such references
|
||||||
without an associated object in sizeof/decltype/alignof.
|
without an associated object in sizeof/decltype/alignof.
|
||||||
|
@ -778,12 +778,18 @@ pushdecl_maybe_friend (tree x, bool is_friend)
|
|||||||
if ((TREE_CODE (x) == FUNCTION_DECL)
|
if ((TREE_CODE (x) == FUNCTION_DECL)
|
||||||
&& DECL_EXTERN_C_P (x)
|
&& DECL_EXTERN_C_P (x)
|
||||||
/* We should ignore declarations happening in system headers. */
|
/* We should ignore declarations happening in system headers. */
|
||||||
|
&& !DECL_ARTIFICIAL (x)
|
||||||
&& !DECL_IN_SYSTEM_HEADER (x))
|
&& !DECL_IN_SYSTEM_HEADER (x))
|
||||||
{
|
{
|
||||||
cxx_binding *function_binding =
|
cxx_binding *function_binding =
|
||||||
lookup_extern_c_fun_binding_in_all_ns (x);
|
lookup_extern_c_fun_binding_in_all_ns (x);
|
||||||
if (function_binding
|
tree previous = (function_binding
|
||||||
&& !DECL_IN_SYSTEM_HEADER (function_binding->value))
|
? function_binding->value
|
||||||
|
: NULL_TREE);
|
||||||
|
if (previous
|
||||||
|
&& !DECL_ARTIFICIAL (previous)
|
||||||
|
&& !DECL_IN_SYSTEM_HEADER (previous)
|
||||||
|
&& DECL_CONTEXT (previous) != DECL_CONTEXT (x))
|
||||||
{
|
{
|
||||||
tree previous = function_binding->value;
|
tree previous = function_binding->value;
|
||||||
|
|
||||||
@ -810,6 +816,14 @@ pushdecl_maybe_friend (tree x, bool is_friend)
|
|||||||
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
|
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pedwarn (input_location, 0,
|
||||||
|
"declaration of %q#D with C language linkage", x);
|
||||||
|
pedwarn (input_location, 0,
|
||||||
|
"conflicts with previous declaration %q+#D",
|
||||||
|
previous);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
2009-03-31 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* g++.old-deja/g++.other/using9.C: Add expected errors.
|
||||||
|
|
||||||
2009-03-31 H.J. Lu <hongjiu.lu@intel.com>
|
2009-03-31 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* gcc.c-torture/compile/pr33009.c: Removed.
|
* gcc.c-torture/compile/pr33009.c: Removed.
|
||||||
|
@ -13,9 +13,9 @@ struct x {};
|
|||||||
using ::x;
|
using ::x;
|
||||||
using ::a;
|
using ::a;
|
||||||
|
|
||||||
extern "C" void foo ();
|
extern "C" void foo (); // { dg-error "previous declaration" }
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
extern "C" int foo ();
|
extern "C" int foo (); // { dg-error "C.*linkage" }
|
||||||
using ::foo; // { dg-error "" } already in use
|
using ::foo; // { dg-error "" } already in use
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
2009-03-31 Jason Merrill <jason@redhat.com>
|
2009-03-31 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
* libsupc++/unwind-cxx.h: Correct __cxa_call_terminate prototype.
|
||||||
|
|
||||||
PR libstdc++/39310
|
PR libstdc++/39310
|
||||||
* include/tr1_impl/type_traits (is_function): Add partial
|
* include/tr1_impl/type_traits (is_function): Add partial
|
||||||
specializations with function cv-quals.
|
specializations with function cv-quals.
|
||||||
|
@ -192,7 +192,7 @@ extern "C" void __cxa_bad_typeid ();
|
|||||||
// throws, and if bad_exception needs to be thrown. Called from the
|
// throws, and if bad_exception needs to be thrown. Called from the
|
||||||
// compiler.
|
// compiler.
|
||||||
extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn));
|
extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn));
|
||||||
extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn));
|
extern "C" void __cxa_call_terminate (_Unwind_Exception*) __attribute__((noreturn));
|
||||||
|
|
||||||
#ifdef __ARM_EABI_UNWINDER__
|
#ifdef __ARM_EABI_UNWINDER__
|
||||||
// Arm EABI specified routines.
|
// Arm EABI specified routines.
|
||||||
|
Loading…
Reference in New Issue
Block a user