Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/noexcept09.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 1830386684a0 |
children |
rev | line source |
---|---|
111 | 1 // Test that -Wnoexcept works with templates |
2 // { dg-do compile { target c++11 } } | |
3 // { dg-options "-Wnoexcept" } | |
4 | |
5 template <class T> | |
145 | 6 T f (T t) { return t; } // { dg-message "does not throw" } |
111 | 7 |
8 #define SA(X) static_assert(X, #X) | |
9 | |
10 SA (!noexcept(f(1))); // { dg-warning "noexcept" } | |
11 | |
12 int main() | |
13 { | |
14 f(1); // Use f(int) so it gets instantiated | |
15 } |