blob: 84bd89b210fcc9aa5ec3e5a61490bfeb15fa309a [file] [log] [blame]
Douglas Gregor6f4596c2011-03-11 23:10:44 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
Sebastian Redl33deb352012-02-22 10:50:08 +00003// Test that a very basic variation of generalized initializer returns (that
Sebastian Redl5b38a0f2012-02-22 17:38:04 +00004// required for libstdc++ 4.5) is supported in C++98.
Douglas Gregor6f4596c2011-03-11 23:10:44 +00005
6int test0(int i) {
Stephen Hines0e2c34f2015-03-23 12:09:02 -07007 return { i }; // expected-warning{{generalized initializer lists are a C++11 extension}} expected-warning {{scalar}}
Douglas Gregor6f4596c2011-03-11 23:10:44 +00008}
9
10template<typename T, typename U>
11T test1(U u) {
Sebastian Redl33deb352012-02-22 10:50:08 +000012 return { u }; // expected-warning{{generalized initializer lists are a C++11 extension}}
Douglas Gregor6f4596c2011-03-11 23:10:44 +000013}
14
15template int test1(char);
16template long test1(int);