summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/cxx0x-return-init-list.cpp
blob: 2aeec7bff7c85fdc62416d7d92258b580a8a9b91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s

// Test that a very basic variation of generalized initializer returns (that
// required for libstdc++ 4.5) is supported in C++98.

int test0(int i) {
  return { i }; // expected-warning{{generalized initializer lists are a C++11 extension}} expected-warning {{scalar}}
}

template<typename T, typename U>
T test1(U u) {
  return { u }; // expected-warning{{generalized initializer lists are a C++11 extension}}
}

template int test1(char);
template long test1(int);
OpenPOWER on IntegriCloud