diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 082e335aaef67034ae66ca1a2df94cf6c625bd5c..7e2db69fd62be250eada043385210ca4b313767b 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -4277,12 +4277,18 @@ void Parser::ParseFunctionDeclarator(Declarator &D, IsCXX11MemberFunction); // Parse exception-specification[opt]. + // FIXME: Remove the code to perform delayed parsing of exception + // specifications. +#if 0 bool Delayed = (D.getContext() == Declarator::MemberContext && D.getDeclSpec().getStorageClassSpec() != DeclSpec::SCS_typedef && !D.getDeclSpec().isFriendSpecified()); for (unsigned i = 0, e = D.getNumTypeObjects(); Delayed && i != e; ++i) Delayed &= D.getTypeObject(i).Kind == DeclaratorChunk::Paren; +#else + const bool Delayed = false; +#endif ESpecType = tryParseExceptionSpecification(Delayed, ESpecRange, DynamicExceptions, diff --git a/test/CXX/class/class.mem/p2.cpp b/test/CXX/class/class.mem/p2.cpp index 02ef9d7bbc33386765e6c0d576bffd4651265f4e..4aa4a5c6f1b7b9341bf4cd01b6595191abf0cf74 100644 --- a/test/CXX/class/class.mem/p2.cpp +++ b/test/CXX/class/class.mem/p2.cpp @@ -56,33 +56,3 @@ namespace test3 { template struct A2<int>; } - -namespace PR12629 { - struct S { - static int (f)() throw(); - static int ((((((g))))() throw(U))); - int (*h)() noexcept(false); - static int (&i)() noexcept(true); - static int (*j)() throw(U); // expected-error {{type name}} \ - // expected-error {{expected ')'}} expected-note {{to match}} - - struct U {}; - }; - static_assert(noexcept(S::f()), ""); - static_assert(!noexcept(S::g()), ""); - static_assert(!noexcept(S().h()), ""); - static_assert(noexcept(S::i()), ""); -} - -namespace PR12688 { - struct S { - // FIXME: Producing one error saying this can't have the same name - // as the class because it's not a constructor, then producing - // another error saying this can't have a return type because - // it is a constructor, is redundant and inconsistent. - nonsense S() throw (more_nonsense); // \ - // expected-error {{'nonsense'}} \ - // expected-error {{has the same name as its class}} \ - // expected-error {{constructor cannot have a return type}} - }; -} diff --git a/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp b/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp index ad4f4064c255227ce988d729f3472650f38d0879..030c90c525c0ed398750d736fc358b7a36141622 100644 --- a/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp +++ b/test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp @@ -91,10 +91,11 @@ namespace Static { namespace PR12564 { struct Base { - void bar(Base&) {} + void bar(Base&) {} // unexpected-note {{here}} }; struct Derived : Base { - void foo(Derived& d) noexcept(noexcept(d.bar(d))) {} + // FIXME: This should be accepted. + void foo(Derived& d) noexcept(noexcept(d.bar(d))) {} // unexpected-error {{cannot bind to a value of unrelated type}} }; } diff --git a/test/SemaCXX/dependent-noexcept-unevaluated.cpp b/test/SemaCXX/dependent-noexcept-unevaluated.cpp index fad8d0918d530452ed42efd7b0d014beeaaa085c..0a3a8bb250bc5c6df3c993c57165815e32738334 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 @@ -38,4 +38,3 @@ int main() { array<DefaultOnly, 1> a, b; } - diff --git a/test/SemaCXX/implicit-exception-spec.cpp b/test/SemaCXX/implicit-exception-spec.cpp index f3a070a01f74ca4c9e239ec7595a4590a4bf13a5..25316f8d51ee5bb3fb9f50d23beeedc5c7310080 100644 --- a/test/SemaCXX/implicit-exception-spec.cpp +++ b/test/SemaCXX/implicit-exception-spec.cpp @@ -40,9 +40,12 @@ namespace InClassInitializers { } namespace ExceptionSpecification { - struct Nested { + // A type is permitted to be used in a dynamic exception specification when it + // is still being defined, but isn't complete within such an exception + // specification. + struct Nested { // expected-note {{not complete}} struct T { - T() noexcept(!noexcept(Nested())); // expected-error{{exception specification is not available until end of class definition}} + T() noexcept(!noexcept(Nested())); // expected-error{{incomplete type}} } t; }; }