[PATCH] Fix testsuite regression caused by r271077

Jonathan Wakely jwakely@redhat.com
Mon May 13 19:55:00 GMT 2019


	* 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.

Tested powerpc64le-linux, OK for trunk?

-------------- next part --------------
commit d6f2a60080d43fe2c881bc0898f45c834ab29886
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon May 13 17:28:49 2019 +0100

    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.

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 <new>
 __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 }


More information about the Gcc-patches mailing list