Home | History | Annotate | Download | only in drs
      1 // RUN: %clang_cc1 -std=c++98 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
      2 // RUN: %clang_cc1 -std=c++11 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
      3 // RUN: %clang_cc1 -std=c++14 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
      4 // RUN: %clang_cc1 -std=c++1z %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
      5 
      6 // expected-no-diagnostics
      7 
      8 #if __cplusplus >= 201103L
      9 namespace dr1756 {  // dr1756: 3.7 c++11
     10   // Direct-list-initialization of a non-class object
     11 
     12   int a{0};
     13 
     14   struct X { operator int(); } x;
     15   int b{x};
     16 } // dr1756
     17 
     18 namespace dr1758 {  // dr1758: 3.7 c++11
     19   // Explicit conversion in copy/move list initialization
     20 
     21   struct X { X(); };
     22   struct Y { explicit operator X(); } y;
     23   X x{y};
     24 
     25   struct A {
     26     A() {}
     27     A(const A &) {}
     28   };
     29   struct B {
     30     operator A() { return A(); }
     31   } b;
     32   A a{b};
     33 } // dr1758
     34 #endif
     35