| 1 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s |
| 2 | |
| 3 | // Test that a very basic variation of generalized initializer returns (that |
| 4 | // required for libstdc++ 4.5) is supported in C++98. |
| 5 | |
| 6 | int test0(int i) { |
| 7 | return { i }; // expected-warning{{generalized initializer lists are a C++11 extension}} expected-warning {{scalar}} |
| 8 | } |
| 9 | |
| 10 | template<typename T, typename U> |
| 11 | T test1(U u) { |
| 12 | return { u }; // expected-warning{{generalized initializer lists are a C++11 extension}} |
| 13 | } |
| 14 | |
| 15 | template int test1(char); |
| 16 | template long test1(int); |
| 17 | |