From dac9376aeebc6021e3a73c34f5b8bc7e87e09fc7 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Fri, 4 Nov 2016 15:30:52 +0000 Subject: [PATCH] re PR c++/71973 (c++ handles built-in functions inconsistently) 2016-11-04 Bernd Edlinger PR c++/71973 * g++.dg/cpp1y/lambda-generic-udt.C: Fix builtin function declaration. * g++.dg/init/new15.C: Likewise. * g++.dg/ipa/inline-1.C: Likewise. * g++.dg/ipa/inline-2.C: Likewise. * g++.dg/lto/20080908-1_0.C: Likewise. * g++.dg/tc1/dr20.C: Likewise. * g++.dg/tree-ssa/inline-1.C: Likewise. * g++.dg/tree-ssa/inline-2.C: Likewise. * g++.old-deja/g++.law/except1.C: Likewise. * g++.old-deja/g++.other/vbase5.C: Likewise. * obj-c++.dg/lto/trivial-1_0.mm: Likewise. From-SVN: r241846 --- gcc/testsuite/ChangeLog | 15 +++++++++++++++ gcc/testsuite/g++.dg/cpp1y/lambda-generic-udt.C | 2 +- gcc/testsuite/g++.dg/init/new15.C | 2 +- gcc/testsuite/g++.dg/ipa/inline-1.C | 2 +- gcc/testsuite/g++.dg/ipa/inline-2.C | 2 +- gcc/testsuite/g++.dg/lto/20080908-1_0.C | 2 +- gcc/testsuite/g++.dg/tc1/dr20.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/inline-1.C | 2 +- gcc/testsuite/g++.dg/tree-ssa/inline-2.C | 2 +- gcc/testsuite/g++.old-deja/g++.law/except1.C | 2 +- gcc/testsuite/g++.old-deja/g++.other/vbase5.C | 2 +- gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm | 2 +- 12 files changed, 26 insertions(+), 11 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f25bfd7d60c..10e6a57474f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,18 @@ +2016-11-04 Bernd Edlinger + + PR c++/71973 + * g++.dg/cpp1y/lambda-generic-udt.C: Fix builtin function declaration. + * g++.dg/init/new15.C: Likewise. + * g++.dg/ipa/inline-1.C: Likewise. + * g++.dg/ipa/inline-2.C: Likewise. + * g++.dg/lto/20080908-1_0.C: Likewise. + * g++.dg/tc1/dr20.C: Likewise. + * g++.dg/tree-ssa/inline-1.C: Likewise. + * g++.dg/tree-ssa/inline-2.C: Likewise. + * g++.old-deja/g++.law/except1.C: Likewise. + * g++.old-deja/g++.other/vbase5.C: Likewise. + * obj-c++.dg/lto/trivial-1_0.mm: Likewise. + 2016-11-04 Bill Schmidt PR tree-optimization/78210 diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-udt.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-udt.C index 3597fa8053a..1b0f65e6381 100644 --- a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-udt.C +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-udt.C @@ -14,7 +14,7 @@ struct S bool shadow = false; }; -extern "C" void printf(...); +extern "C" int printf(const char*, ...); #define assert(e) if (e); else \ printf ("%s:%d: !(%s)\n", __FILE__, __LINE__, #e), __builtin_abort (); diff --git a/gcc/testsuite/g++.dg/init/new15.C b/gcc/testsuite/g++.dg/init/new15.C index b93b43c833f..1f57f07dfc3 100644 --- a/gcc/testsuite/g++.dg/init/new15.C +++ b/gcc/testsuite/g++.dg/init/new15.C @@ -1,6 +1,6 @@ // PR c++/9782 -extern "C" void printf(const char*, ...); +extern "C" int printf(const char*, ...); template struct A { diff --git a/gcc/testsuite/g++.dg/ipa/inline-1.C b/gcc/testsuite/g++.dg/ipa/inline-1.C index 9ea614b295d..d570dc67e28 100644 --- a/gcc/testsuite/g++.dg/ipa/inline-1.C +++ b/gcc/testsuite/g++.dg/ipa/inline-1.C @@ -3,7 +3,7 @@ /* { dg-add-options bind_pic_locally } */ namespace std { - extern "C" void puts(const char *s); + extern "C" int puts(const char *s); } template void diff --git a/gcc/testsuite/g++.dg/ipa/inline-2.C b/gcc/testsuite/g++.dg/ipa/inline-2.C index cc5b2559ae7..eb0f21b1247 100644 --- a/gcc/testsuite/g++.dg/ipa/inline-2.C +++ b/gcc/testsuite/g++.dg/ipa/inline-2.C @@ -3,7 +3,7 @@ /* { dg-add-options bind_pic_locally } */ namespace std { - extern "C" void puts(const char *s); + extern "C" int puts(const char *s); } template void diff --git a/gcc/testsuite/g++.dg/lto/20080908-1_0.C b/gcc/testsuite/g++.dg/lto/20080908-1_0.C index 8b761c0844c..42b20cb3b3a 100644 --- a/gcc/testsuite/g++.dg/lto/20080908-1_0.C +++ b/gcc/testsuite/g++.dg/lto/20080908-1_0.C @@ -1,5 +1,5 @@ /* { dg-lto-do run } */ -extern "C" { extern void *memcpy (void *, const void *, unsigned); } +extern "C" { extern void *memcpy (void *, const void *, __SIZE_TYPE__); } inline int bci (const float &source) diff --git a/gcc/testsuite/g++.dg/tc1/dr20.C b/gcc/testsuite/g++.dg/tc1/dr20.C index fe586212995..93338518190 100644 --- a/gcc/testsuite/g++.dg/tc1/dr20.C +++ b/gcc/testsuite/g++.dg/tc1/dr20.C @@ -2,7 +2,7 @@ // Origin: Giovanni Bajo // DR20: Some clarifications needed for 12.8 para 15 -extern "C" void printf(const char*, ...); +extern "C" int printf(const char*, ...); extern "C" void abort(void); int count = 0; diff --git a/gcc/testsuite/g++.dg/tree-ssa/inline-1.C b/gcc/testsuite/g++.dg/tree-ssa/inline-1.C index 1abfa324ad5..4497facb87b 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/inline-1.C +++ b/gcc/testsuite/g++.dg/tree-ssa/inline-1.C @@ -3,7 +3,7 @@ /* { dg-add-options bind_pic_locally } */ namespace std { - extern "C" void puts(const char *s); + extern "C" int puts(const char *s); } template void diff --git a/gcc/testsuite/g++.dg/tree-ssa/inline-2.C b/gcc/testsuite/g++.dg/tree-ssa/inline-2.C index 53e609ecd8f..79f807cd220 100644 --- a/gcc/testsuite/g++.dg/tree-ssa/inline-2.C +++ b/gcc/testsuite/g++.dg/tree-ssa/inline-2.C @@ -3,7 +3,7 @@ /* { dg-add-options bind_pic_locally } */ namespace std { - extern "C" void puts(const char *s); + extern "C" int puts(const char *s); } template void diff --git a/gcc/testsuite/g++.old-deja/g++.law/except1.C b/gcc/testsuite/g++.old-deja/g++.law/except1.C index 9a2123c3e86..d11afc8b64f 100644 --- a/gcc/testsuite/g++.old-deja/g++.law/except1.C +++ b/gcc/testsuite/g++.old-deja/g++.law/except1.C @@ -7,7 +7,7 @@ // Subject: Bugs // Date: Wed, 22 Jul 92 08:29:30 EDT -extern "C" void puts(const char *); +extern "C" int puts(const char *); class foo { public: diff --git a/gcc/testsuite/g++.old-deja/g++.other/vbase5.C b/gcc/testsuite/g++.old-deja/g++.other/vbase5.C index 10c2f313157..3d22ff50dff 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/vbase5.C +++ b/gcc/testsuite/g++.old-deja/g++.other/vbase5.C @@ -6,7 +6,7 @@ // vbases. Normally that's just a pessimization, unfortunately during // constructoring it leads to uninitialized reads. -extern "C" int printf (...); +extern "C" int printf (const char*,...); int fail = 0; diff --git a/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm b/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm index 45b6e702481..744a017bef6 100644 --- a/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm +++ b/gcc/testsuite/obj-c++.dg/lto/trivial-1_0.mm @@ -1,7 +1,7 @@ /* { dg-lto-do run } */ /* { dg-skip-if "Needs OBJC2 ABI" { "*-*-darwin*" && lp64 } { "*" } { "" } } */ extern "C" { -extern int printf (char *,...) ; +extern int printf (const char *,...) ; extern void abort (void) ; } -- 2.30.2