* decl.c (decls_match): A non-extern-C declaration doesn't match
a builtin extern-C declaration.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149638
138bc75d-0d04-0410-961f-
82ee72b054a4
2009-07-14 Jason Merrill <jason@redhat.com>
+ PR c++/37276
+ * decl.c (decls_match): A non-extern-C declaration doesn't match
+ a builtin extern-C declaration.
+
PR c++/40746
* name-lookup.c (qualified_lookup_using_namespace): Don't stop
looking in used namespaces just because we found something on
PR c++/40740
* semantics.c (perform_koenig_lookup): Handle empty template args.
-2009-07-13 Jason Merrill <jason@redhat.com>
-
* call.c (build_over_call): Use can_trust_pointer_alignment.
2009-07-14 Dodji Seketeli <dodji@redhat.com>
&& DECL_EXTERN_C_P (olddecl)))
return 0;
+#ifdef NO_IMPLICIT_EXTERN_C
+ /* A new declaration doesn't match a built-in one unless it
+ is also extern "C". */
+ if (DECL_BUILT_IN (olddecl)
+ && DECL_EXTERN_C_P (olddecl) && !DECL_EXTERN_C_P (newdecl))
+ return 0;
+#endif
+
if (TREE_CODE (f1) != TREE_CODE (f2))
return 0;
2009-07-14 Jason Merrill <jason@redhat.com>
+ PR c++/37276
+ * g++.dg/lookup/builtin5.C: New.
+ * g++.dg/other/error22.C: Add missing extern "C".
+ * g++.dg/warn/Warray-bounds.C: Likewise.
+ * gcc.dg/compat/compat-common.h: Likewise.
+
PR c++/40746
* g++.dg/lookup/using20.C: New.
--- /dev/null
+// PR c++/37276
+
+// { dg-final { scan-assembler "_ZSt5atanhd" } }
+
+namespace std
+{
+ inline double
+ atanh(double __x)
+ { return __builtin_atanh(__x); }
+}
+
+int main()
+{
+ std::atanh(.3);
+ return 0;
+}
// PR c++/34394
// { dg-do compile }
-extern double fabs (double);
+extern "C" double fabs (double);
void foo (double x)
{
int a[10];
+extern "C" __SIZE_TYPE__ strlen(const char *s);
+
static inline int n(void) {
- __SIZE_TYPE__ strlen(const char *s);
return strlen("12345");
}
#endif
#endif
+#ifdef __cplusplus
+extern "C" void abort (void);
+#else
extern void abort (void);
+#endif
extern int fails;