Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / dcl.dcl / p4-0x.cpp
blob22b10b60ecd1b1292b4a44c5807e58a1401d4c1e
1 // RUN: %clang_cc1 -std=c++11 -verify -fsyntax-only %s
3 struct S {
4 constexpr S(bool b) : b(b) {}
5 constexpr explicit operator bool() const { return b; }
6 bool b;
7 };
8 struct T {
9 constexpr operator int() const { return 1; }
11 struct U {
12 constexpr operator int() const { return 1; } // expected-note {{candidate}}
13 constexpr operator long() const { return 0; } // expected-note {{candidate}}
16 static_assert(S(true), "");
17 static_assert(S(false), "not so fast"); // expected-error {{not so fast}}
18 static_assert(T(), "");
19 static_assert(U(), ""); // expected-error {{ambiguous}}
21 static_assert(false, L"\x14hi" // expected-warning {{encoding prefix 'L' on an unevaluated string literal has no effect and is incompatible with c++2c}} \
22 // expected-error {{invalid escape sequence '\x14' in an unevaluated string literal}}
23 "!"
24 R"x(")x");