[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / cxx11-default-member-initializers.cpp
blob9353e633fafbcb543ae2debb77cf2364a1adb204
1 // RUN: %clang_cc1 -std=c++11 -verify %s -pedantic
3 namespace PR31692 {
4 struct A {
5 struct X { int n = 0; } x;
6 // Trigger construction of X() from a SFINAE context. This must not mark
7 // any part of X as invalid.
8 static_assert(!__is_constructible(X), "");
9 // Check that X::n is not marked invalid.
10 double &r = x.n; // expected-error {{non-const lvalue reference to type 'double' cannot bind to a value of unrelated type 'int'}}
12 // A::X can now be default-constructed.
13 static_assert(__is_constructible(A::X), "");