xref: /minix3/external/bsd/llvm/dist/clang/test/Parser/cxx11-brace-initializers.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
2*f4a2713aSLionel Sambuc // expected-no-diagnostics
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc struct S {
SS5*f4a2713aSLionel Sambuc   S(int, int) {}
6*f4a2713aSLionel Sambuc };
7*f4a2713aSLionel Sambuc 
f(int,S const &,int)8*f4a2713aSLionel Sambuc void f(int, S const&, int) {}
9*f4a2713aSLionel Sambuc 
test1()10*f4a2713aSLionel Sambuc void test1()
11*f4a2713aSLionel Sambuc {
12*f4a2713aSLionel Sambuc   S X1{1, 1,};
13*f4a2713aSLionel Sambuc   S X2 = {1, 1,};
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc   f(0, {1, 1}, 0);
16*f4a2713aSLionel Sambuc }
17*f4a2713aSLionel Sambuc 
18*f4a2713aSLionel Sambuc namespace PR14948 {
19*f4a2713aSLionel Sambuc   template<typename T> struct Q { static T x; };
20*f4a2713aSLionel Sambuc 
21*f4a2713aSLionel Sambuc   struct X {};
22*f4a2713aSLionel Sambuc   template<> X Q<X>::x {};
23*f4a2713aSLionel Sambuc   template<> int Q<int[]>::x[] { 1, 2, 3 };
24*f4a2713aSLionel Sambuc   template<> int Q<int>::x { 1 };
25*f4a2713aSLionel Sambuc 
26*f4a2713aSLionel Sambuc   template<typename T> T Q<T>::x {};
27*f4a2713aSLionel Sambuc }
28