diff options
Diffstat (limited to 'clang/test/AST/Interp/cxx20.cpp')
| -rw-r--r-- | clang/test/AST/Interp/cxx20.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/AST/Interp/cxx20.cpp b/clang/test/AST/Interp/cxx20.cpp index da80454b7a82..27dbd2818be6 100644 --- a/clang/test/AST/Interp/cxx20.cpp +++ b/clang/test/AST/Interp/cxx20.cpp @@ -841,3 +841,20 @@ namespace VariadicCallOperator { } constexpr int A = foo(); } + +namespace DefinitionLoc { + + struct NonConstexprCopy { + constexpr NonConstexprCopy() = default; + NonConstexprCopy(const NonConstexprCopy &); + constexpr NonConstexprCopy(NonConstexprCopy &&) = default; + + int n = 42; + }; + + NonConstexprCopy::NonConstexprCopy(const NonConstexprCopy &) = default; // both-note {{here}} + + constexpr NonConstexprCopy ncc1 = NonConstexprCopy(NonConstexprCopy()); + constexpr NonConstexprCopy ncc2 = ncc1; // both-error {{constant expression}} \ + // both-note {{non-constexpr constructor}} +} |
