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
* semantics.c (finish_non_static_data_member): Allow such references
without an associated object in sizeof/decltype/alignof.
if ((TREE_CODE (x) == FUNCTION_DECL)
&& DECL_EXTERN_C_P (x)
/* We should ignore declarations happening in system headers. */
+ && !DECL_ARTIFICIAL (x)
&& !DECL_IN_SYSTEM_HEADER (x))
{
cxx_binding *function_binding =
lookup_extern_c_fun_binding_in_all_ns (x);
- if (function_binding
- && !DECL_IN_SYSTEM_HEADER (function_binding->value))
+ tree previous = (function_binding
+ ? 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;
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);
+ }
}
}
+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>
* gcc.c-torture/compile/pr33009.c: Removed.
2009-03-31 Jason Merrill <jason@redhat.com>
+ * libsupc++/unwind-cxx.h: Correct __cxa_call_terminate prototype.
+
PR libstdc++/39310
* include/tr1_impl/type_traits (is_function): Add partial
specializations with function cv-quals.
// throws, and if bad_exception needs to be thrown. Called from the
// compiler.
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__
// Arm EABI specified routines.