OSDN Git Service

PR c++/6057
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / noexcept09.C
1 // Test that -Wnoexcept works with templates
2 // { dg-options "-std=c++0x -Wnoexcept" }
3
4 template <class T>
5 T f (T t) { return t; }         // { dg-warning "does not throw" }
6
7 #define SA(X) static_assert(X, #X)
8
9 SA (!noexcept(f(1)));           // { dg-warning "noexcept" }
10
11 int main()
12 {
13   f(1);                         // Use f(int) so it gets instantiated
14 }