diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-04-16 18:27:27 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-04-16 18:27:27 +0000 |
commit | 74e2fc332e07c76d4e69ccbd0e9e47a0bafd3908 (patch) | |
tree | e13935dca7e6eaa9e934215f7517e99dd591fcb4 /test/SemaCXX/implicit-exception-spec.cpp | |
parent | 0f90590c96375052c67116f620fafa2b1eadb41e (diff) | |
download | clang-74e2fc332e07c76d4e69ccbd0e9e47a0bafd3908.tar.gz |
Implement the last part of C++ [class.mem]p2, delaying the parsing of
exception specifications on member functions until after the closing
'}' for the containing class. This allows, for example, a member
function to throw an instance of its own class. Fixes PR12564 and a
fairly embarassing oversight in our C++98/03 support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154844 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/implicit-exception-spec.cpp')
-rw-r--r-- | test/SemaCXX/implicit-exception-spec.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/test/SemaCXX/implicit-exception-spec.cpp b/test/SemaCXX/implicit-exception-spec.cpp index 786e8f4a14..143d9f7cc8 100644 --- a/test/SemaCXX/implicit-exception-spec.cpp +++ b/test/SemaCXX/implicit-exception-spec.cpp @@ -39,20 +39,14 @@ namespace InClassInitializers { bool z = noexcept(Nested::Inner()); } -// FIXME: -// The same problem arises in delayed parsing of exception specifications, -// which clang does not yet support. namespace ExceptionSpecification { - struct Nested { // expected-note {{not complete}} + struct Nested { struct T { - T() noexcept(!noexcept(Nested())); // expected-error {{incomplete type}} + T() noexcept(!noexcept(Nested())); // expected-error{{exception specification is not available until end of class definition}} } t; }; } -// FIXME: -// The same problem arises in delayed parsing of default arguments, -// which clang does not yet support. namespace DefaultArgument { struct Default { struct T { |