diff options
| author | Douglas Gregor <dgregor@apple.com> | 2012-08-30 21:47:37 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2012-08-30 21:47:37 +0000 |
| commit | a3d3fe9be67754bda158dab73689e1e44a920b87 (patch) | |
| tree | 964761cddd7ad6bcdbc2bb928f4834cecc407920 /clang/test/SemaCXX/cxx98-compat.cpp | |
| parent | 7578a47fb8d57042ba4b43edc415499f5d784b58 (diff) | |
| download | bcm5719-llvm-a3d3fe9be67754bda158dab73689e1e44a920b87.tar.gz bcm5719-llvm-a3d3fe9be67754bda158dab73689e1e44a920b87.zip | |
The presence of a user-*declared* constructor makes the default
constructor not user provided (and, therefore, non-trivial). Fixes
<rdar://problem/11736429>.
llvm-svn: 162947
Diffstat (limited to 'clang/test/SemaCXX/cxx98-compat.cpp')
| -rw-r--r-- | clang/test/SemaCXX/cxx98-compat.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/cxx98-compat.cpp b/clang/test/SemaCXX/cxx98-compat.cpp index 37341f88561..249195564ad 100644 --- a/clang/test/SemaCXX/cxx98-compat.cpp +++ b/clang/test/SemaCXX/cxx98-compat.cpp @@ -362,3 +362,14 @@ namespace AssignOpUnion { b y; // expected-warning {{union member 'y' with a non-trivial copy assignment operator is incompatible with C++98}} }; } + +namespace rdar11736429 { + struct X { + X(const X&) = delete; // expected-warning{{deleted function definitions are incompatible with C++98}} \ + // expected-note{{because type 'rdar11736429::X' has a user-declared constructor}} + }; + + union S { + X x; // expected-warning{{union member 'x' with a non-trivial constructor is incompatible with C++98}} + }; +} |

