cxx11-brace-initializers.cpp 447 B

123456789101112131415161718192021222324252627
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
  2. // expected-no-diagnostics
  3. struct S {
  4. S(int, int) {}
  5. };
  6. void f(int, S const&, int) {}
  7. void test1()
  8. {
  9. S X1{1, 1,};
  10. S X2 = {1, 1,};
  11. f(0, {1, 1}, 0);
  12. }
  13. namespace PR14948 {
  14. template<typename T> struct Q { static T x; };
  15. struct X {};
  16. template<> X Q<X>::x {};
  17. template<> int Q<int[]>::x[] { 1, 2, 3 };
  18. template<> int Q<int>::x { 1 };
  19. template<typename T> T Q<T>::x {};
  20. }