From: Jonathan Wakely Date: Mon, 13 May 2019 20:11:52 +0000 (+0100) Subject: Fix testsuite regression caused by r271077 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0dd50fc6f13c02d9d548fd57e7f8f7020241e317;p=gcc.git Fix testsuite regression caused by r271077 * g++.dg/cpp0x/Wattributes1.C: Adjust dg-error line number to fix regression, by matching a note on any line. * g++.dg/cpp0x/Wattributes2.C: Add another copy that checks the correct line number is matched without depending on a library header. From-SVN: r271133 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ebefd00c02d..6c6bbc3b339 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2019-05-13 Jonathan Wakely + + * g++.dg/cpp0x/Wattributes1.C: Adjust dg-error line number to fix + regression, by matching a note on any line. + * g++.dg/cpp0x/Wattributes2.C: Add another copy that checks the + correct line number is matched without depending on a library header. + 2019-05-13 Richard Biener PR tree-optimization/90402 diff --git a/gcc/testsuite/g++.dg/cpp0x/Wattributes1.C b/gcc/testsuite/g++.dg/cpp0x/Wattributes1.C index b1c48d42349..2223936fba3 100644 --- a/gcc/testsuite/g++.dg/cpp0x/Wattributes1.C +++ b/gcc/testsuite/g++.dg/cpp0x/Wattributes1.C @@ -5,4 +5,4 @@ #include __attribute__((visibility("hidden")))void*operator new(std::size_t); // { dg-warning "visibility attribute ignored" } -// { dg-message "previous declaration" "" { target *-*-* } 125 } +// { dg-message "previous declaration" "" { target *-*-* } 0 } diff --git a/gcc/testsuite/g++.dg/cpp0x/Wattributes2.C b/gcc/testsuite/g++.dg/cpp0x/Wattributes2.C new file mode 100644 index 00000000000..f37b1f010ca --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/Wattributes2.C @@ -0,0 +1,32 @@ +// PR c++/60373 +// { dg-do compile { target c++11 } } +// { dg-require-visibility "" } + +#pragma GCC visibility push(default) +namespace std +{ + using size_t = decltype(sizeof(0)); + struct nothrow_t { }; +} + +void* operator new(std::size_t) + __attribute__((__externally_visible__)); +void* operator new[](std::size_t) + __attribute__((__externally_visible__)); +void* operator new(std::size_t, const std::nothrow_t&) noexcept + __attribute__((__externally_visible__, __malloc__)); +void* operator new[](std::size_t, const std::nothrow_t&) noexcept + __attribute__((__externally_visible__, __malloc__)); +void operator delete(void*) noexcept + __attribute__((__externally_visible__)); +void operator delete[](void*) noexcept + __attribute__((__externally_visible__)); +void operator delete(void*, const std::nothrow_t&) noexcept + __attribute__((__externally_visible__)); +void operator delete[](void*, const std::nothrow_t&) noexcept + __attribute__((__externally_visible__)); +#pragma GCC visibility pop + +__attribute__((visibility("hidden")))void*operator new(std::size_t); // { dg-warning "visibility attribute ignored" } + +// { dg-message "previous declaration" "" { target *-*-* } 12 }