[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / cxx0x-return-init-list.cpp
blob2aeec7bff7c85fdc62416d7d92258b580a8a9b91
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // Test that a very basic variation of generalized initializer returns (that
4 // required for libstdc++ 4.5) is supported in C++98.
6 int test0(int i) {
7 return { i }; // expected-warning{{generalized initializer lists are a C++11 extension}} expected-warning {{scalar}}
10 template<typename T, typename U>
11 T test1(U u) {
12 return { u }; // expected-warning{{generalized initializer lists are a C++11 extension}}
15 template int test1(char);
16 template long test1(int);