Douglas Gregor | 6f4596c | 2011-03-11 23:10:44 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 | |
Sebastian Redl | 33deb35 | 2012-02-22 10:50:08 +0000 | [diff] [blame] | 3 | // Test that a very basic variation of generalized initializer returns (that |
Sebastian Redl | 5b38a0f | 2012-02-22 17:38:04 +0000 | [diff] [blame] | 4 | // required for libstdc++ 4.5) is supported in C++98. |
Douglas Gregor | 6f4596c | 2011-03-11 23:10:44 +0000 | [diff] [blame] | 5 | |
| 6 | int test0(int i) { |
Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 7 | return { i }; // expected-warning{{generalized initializer lists are a C++11 extension}} expected-warning {{scalar}} |
Douglas Gregor | 6f4596c | 2011-03-11 23:10:44 +0000 | [diff] [blame] | 8 | } |
| 9 | |
| 10 | template<typename T, typename U> |
| 11 | T test1(U u) { |
Sebastian Redl | 33deb35 | 2012-02-22 10:50:08 +0000 | [diff] [blame] | 12 | return { u }; // expected-warning{{generalized initializer lists are a C++11 extension}} |
Douglas Gregor | 6f4596c | 2011-03-11 23:10:44 +0000 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | template int test1(char); |
| 16 | template long test1(int); |