]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
analyzer: Use noexcept instead of throw() for C++11 and later (PR 96014)
authorJonathan Wakely <jwakely@redhat.com>
Thu, 16 Jul 2020 10:44:32 +0000 (11:44 +0100)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 16:18:16 +0000 (13:18 -0300)
gcc/testsuite/ChangeLog:

PR testsuite/96014
* g++.dg/analyzer/pr94028.C: Replace dynamic exception
specification with noexcept-specifier for C++11 and later.

gcc/testsuite/g++.dg/analyzer/pr94028.C

index c0c35d65829fd8099899ec8dae2e8bd34c247764..5c8e2c9b286b0305587877970b627f07f284f205 100644 (file)
@@ -12,7 +12,12 @@ enum e {} i;
 
 struct j
 {
-  void *operator new (__SIZE_TYPE__ b) throw()
+  void *operator new (__SIZE_TYPE__ b)
+#if __cplusplus >= 201103L
+    noexcept
+#else
+    throw()
+#endif
   {
     return calloc (b, sizeof (int)); // { dg-warning "leak" }
   }