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 | |
parent | 0f90590c96375052c67116f620fafa2b1eadb41e (diff) |
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')
-rw-r--r-- | test/SemaCXX/dependent-noexcept-unevaluated.cpp | 2 | ||||
-rw-r--r-- | test/SemaCXX/implicit-exception-spec.cpp | 10 |
2 files changed, 3 insertions, 9 deletions
diff --git a/test/SemaCXX/dependent-noexcept-unevaluated.cpp b/test/SemaCXX/dependent-noexcept-unevaluated.cpp index 8066b859f1..fad8d0918d 100644 --- a/test/SemaCXX/dependent-noexcept-unevaluated.cpp +++ b/test/SemaCXX/dependent-noexcept-unevaluated.cpp @@ -23,7 +23,7 @@ struct array { T data[N]; - void swap(array& a) noexcept(noexcept(swap(declval<T&>(), declval<T&>()))); + void swap(array& a) noexcept(noexcept(::swap(declval<T&>(), declval<T&>()))); }; struct DefaultOnly 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 { |