aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2013-11-06 18:33:33 -0500
committerDJ Delorie <dj@gcc.gnu.org>2013-11-06 18:33:33 -0500
commit0c249d4b1ddd0e92fe7ca1e92feb57292cad2371 (patch)
tree89a946c331c96eda2b81fece95680fe4c085f7a9 /gcc/c
parent7f4d640cd9ecf834ce2f6ab469076ddd49021374 (diff)
downloadgcc-0c249d4b1ddd0e92fe7ca1e92feb57292cad2371.zip
gcc-0c249d4b1ddd0e92fe7ca1e92feb57292cad2371.tar.gz
gcc-0c249d4b1ddd0e92fe7ca1e92feb57292cad2371.tar.bz2
c-decl.c (locate_old_decl): If a previous conflicting decl is both explicit and builtin...
* c-decl.c (locate_old_decl): If a previous conflicting decl is both explicit and builtin, print the location of the explicit one. * gcc.dg/mismatch-decl-1.c: New test. From-SVN: r204491
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog5
-rw-r--r--gcc/c/c-decl.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 9a9eed3..cc335e4 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,8 @@
+2013-11-06 DJ Delorie <dj@redhat.com>
+
+ * c-decl.c (locate_old_decl): If a previous conflicting decl is
+ both explicit and builtin, print the location of the explicit one.
+
2013-11-05 Tobias Burnus <burnus@net-b.de>
* c-parser.c (c_parser_omp_for, c_parser_omp_parallel,
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c
index 2833fdb..23f0516 100644
--- a/gcc/c/c-decl.c
+++ b/gcc/c/c-decl.c
@@ -1634,7 +1634,8 @@ validate_proto_after_old_defn (tree newdecl, tree newtype, tree oldtype)
static void
locate_old_decl (tree decl)
{
- if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))
+ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl)
+ && !C_DECL_DECLARED_BUILTIN (decl))
;
else if (DECL_INITIAL (decl))
inform (input_location, "previous definition of %q+D was here", decl);