aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-07-14 14:16:03 -0400
committerJason Merrill <jason@gcc.gnu.org>2009-07-14 14:16:03 -0400
commit8353dd9a26485ad8cdc603d98efd8e711f7d2154 (patch)
tree0b8b5bc66f8f98728e58252f4589aa8898afd0df /gcc/cp
parent3deeb3ff03b0df2812a00d6713d4d026f0f2ea7e (diff)
downloadgcc-8353dd9a26485ad8cdc603d98efd8e711f7d2154.zip
gcc-8353dd9a26485ad8cdc603d98efd8e711f7d2154.tar.gz
gcc-8353dd9a26485ad8cdc603d98efd8e711f7d2154.tar.bz2
re PR c++/37276 (Trouble with some (C99?) math builtins and namespace std)
PR c++/37276 * decl.c (decls_match): A non-extern-C declaration doesn't match a builtin extern-C declaration. From-SVN: r149638
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c8
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d43341b8..3197057 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
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
@@ -8,8 +12,6 @@
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>
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d7a0e0d..e1b6678 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -932,6 +932,14 @@ decls_match (tree newdecl, tree olddecl)
&& 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;