diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-11 01:14:52 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-11 01:14:52 +0000 |
commit | bd3051272ce123eb34b2253739404c93bec52d1e (patch) | |
tree | 5879011b6c9034a97447c75f41c3fd27f84df741 /clang/test/CXX/special/class.ctor/p5-0x.cpp | |
parent | d4c0c6cb2232c92f1259c2cb9e233fca9885078a (diff) | |
download | bcm5719-llvm-bd3051272ce123eb34b2253739404c93bec52d1e.tar.gz bcm5719-llvm-bd3051272ce123eb34b2253739404c93bec52d1e.zip |
PR14558: Compute triviality of special members (etc) at the end of the class
definition, rather than at the end of the definition of the set of nested
classes. We still defer checking of the user-specified exception specification
to the end of the nesting -- we can't check that until we've parsed the
in-class initializers for non-static data members.
llvm-svn: 169805
Diffstat (limited to 'clang/test/CXX/special/class.ctor/p5-0x.cpp')
-rw-r--r-- | clang/test/CXX/special/class.ctor/p5-0x.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CXX/special/class.ctor/p5-0x.cpp b/clang/test/CXX/special/class.ctor/p5-0x.cpp index ab8fdb0f1bd..0f4add8c974 100644 --- a/clang/test/CXX/special/class.ctor/p5-0x.cpp +++ b/clang/test/CXX/special/class.ctor/p5-0x.cpp @@ -195,3 +195,15 @@ static_assert(__has_trivial_constructor(Trivial4<int>), "Trivial4 is trivial"); template<typename T> class Trivial5 { Trivial5() = delete; }; static_assert(__has_trivial_constructor(Trivial5<int>), "Trivial5 is trivial"); + +namespace PR14558 { + // Ensure we determine whether an explicitly-defaulted or deleted special + // member is trivial before we return to parsing the containing class. + struct A { + struct B { B() = default; } b; + struct C { C() = delete; } c; + }; + + static_assert(__has_trivial_constructor(A), ""); + static_assert(__has_trivial_constructor(A::B), ""); +} |