diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-08 02:53:02 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-08 02:53:02 +0000 |
commit | 92f241f1881246a657849e27d080fa939293d677 (patch) | |
tree | 9136df8550d176e330a8585afaf87309c1ec04e0 /clang/test/SemaCXX/cxx0x-cursory-default-delete.cpp | |
parent | f77b0f888690e056e7da4efe94f5e97f996f6b05 (diff) | |
download | bcm5719-llvm-92f241f1881246a657849e27d080fa939293d677.tar.gz bcm5719-llvm-92f241f1881246a657849e27d080fa939293d677.zip |
Properly compute triviality for explicitly-defaulted or deleted special members.
Remove pre-standard restriction on explicitly-defaulted copy constructors with
'incorrect' parameter types, and instead just make those special members
non-trivial as the standard requires.
This required making CXXRecordDecl correctly handle classes which have both a
trivial and a non-trivial special member of the same kind.
This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the
new triviality computation technology.
llvm-svn: 169667
Diffstat (limited to 'clang/test/SemaCXX/cxx0x-cursory-default-delete.cpp')
-rw-r--r-- | clang/test/SemaCXX/cxx0x-cursory-default-delete.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/clang/test/SemaCXX/cxx0x-cursory-default-delete.cpp b/clang/test/SemaCXX/cxx0x-cursory-default-delete.cpp index 641760e7e54..b1078dc404b 100644 --- a/clang/test/SemaCXX/cxx0x-cursory-default-delete.cpp +++ b/clang/test/SemaCXX/cxx0x-cursory-default-delete.cpp @@ -36,9 +36,9 @@ struct non_const_derived : non_const_copy { }; struct bad_decls { - bad_decls(volatile bad_decls&) = default; // expected-error {{may not be volatile}} expected-error {{must be defaulted outside the class}} + bad_decls(volatile bad_decls&) = default; // expected-error {{may not be volatile}} bad_decls&& operator = (bad_decls) = default; // expected-error {{lvalue reference}} expected-error {{must return 'bad_decls &'}} - bad_decls& operator = (volatile bad_decls&) = default; // expected-error {{may not be volatile}} expected-error {{must be defaulted outside the class}} + bad_decls& operator = (volatile bad_decls&) = default; // expected-error {{may not be volatile}} bad_decls& operator = (const bad_decls&) const = default; // expected-error {{may not have 'const', 'constexpr' or 'volatile' qualifiers}} }; @@ -57,14 +57,18 @@ struct except_spec_d_good : except_spec_a, except_spec_b { ~except_spec_d_good(); }; except_spec_d_good::~except_spec_d_good() = default; -// FIXME: This should error in the virtual override check. -// It doesn't because we generate the implicit specification later than -// appropriate. +struct except_spec_d_good2 : except_spec_a, except_spec_b { + ~except_spec_d_good2() = default; +}; struct except_spec_d_bad : except_spec_a, except_spec_b { - ~except_spec_d_bad() = default; + ~except_spec_d_bad() noexcept; }; +// FIXME: This should error because this exception spec is not +// compatible with the implicit exception spec. +except_spec_d_bad::~except_spec_d_bad() noexcept = default; -// FIXME: This should error because the exceptions spec doesn't match. +// FIXME: This should error because this exception spec is not +// compatible with the implicit exception spec. struct except_spec_d_mismatch : except_spec_a, except_spec_b { except_spec_d_mismatch() throw(A) = default; }; |