diff options
Diffstat (limited to 'test/SemaCXX')
-rw-r--r-- | test/SemaCXX/constant-expression-cxx11.cpp | 10 | ||||
-rw-r--r-- | test/SemaCXX/lambda-expressions.cpp | 17 | ||||
-rw-r--r-- | test/SemaCXX/warn-consumed-analysis.cpp | 27 |
3 files changed, 53 insertions, 1 deletions
diff --git a/test/SemaCXX/constant-expression-cxx11.cpp b/test/SemaCXX/constant-expression-cxx11.cpp index 6724be7c8204..d73ee4507f7b 100644 --- a/test/SemaCXX/constant-expression-cxx11.cpp +++ b/test/SemaCXX/constant-expression-cxx11.cpp @@ -1863,3 +1863,13 @@ namespace BuiltinStrlen { constexpr char d[] = { 'f', 'o', 'o' }; // no nul terminator. constexpr int bad = __builtin_strlen(d); // expected-error {{constant expression}} expected-note {{one-past-the-end}} } + +namespace PR19010 { + struct Empty {}; + struct Empty2 : Empty {}; + struct Test : Empty2 { + constexpr Test() {} + Empty2 array[2]; + }; + void test() { constexpr Test t; } +} diff --git a/test/SemaCXX/lambda-expressions.cpp b/test/SemaCXX/lambda-expressions.cpp index e2904247c4b4..65f4856dda24 100644 --- a/test/SemaCXX/lambda-expressions.cpp +++ b/test/SemaCXX/lambda-expressions.cpp @@ -282,4 +282,19 @@ namespace lambdas_in_NSDMIs { }; L l; } -}
\ No newline at end of file +} + +namespace PR18473 { + template<typename T> void f() { + T t(0); + (void) [=]{ int n = t; }; // expected-error {{deleted}} + } + + template void f<int>(); + struct NoCopy { + NoCopy(int); + NoCopy(const NoCopy &) = delete; // expected-note {{deleted}} + operator int() const; + }; + template void f<NoCopy>(); // expected-note {{instantiation}} +} diff --git a/test/SemaCXX/warn-consumed-analysis.cpp b/test/SemaCXX/warn-consumed-analysis.cpp index 64fdc00dc516..2c372c752baf 100644 --- a/test/SemaCXX/warn-consumed-analysis.cpp +++ b/test/SemaCXX/warn-consumed-analysis.cpp @@ -793,3 +793,30 @@ void testTemporariesAndOperators2() { } // end namespace InitializerAssertionFailTest + +namespace std { + void move(); + template<class T> + void move(T&&); + + namespace __1 { + void move(); + template<class T> + void move(T&&); + } +} + +namespace PR18260 { + class X { + public: + void move(); + } x; + + void test() { + x.move(); + std::move(); + std::move(x); + std::__1::move(); + std::__1::move(x); + } +} // end namespace PR18260 |