1 // Test that -Wnoexcept works with templates 2 // { dg-options "-std=c++0x -Wnoexcept" } 3 4 template <class T> f(T t)5T 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 main()11int main() 12 { 13 f(1); // Use f(int) so it gets instantiated 14 } 15