From b524fdf0333c370917528bbc0a215d1bf2be984a Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Sat, 12 May 2012 00:19:22 +0000 Subject: Merging r155975: ------------------------------------------------------------------------ r155975 | rsmith | 2012-05-01 18:29:43 -0700 (Tue, 01 May 2012) | 4 lines Disable our non-standard delayed parsing of exception specifications. Delaying the parsing of such things appears to be a conforming extension, but it breaks libstdc++4.7's std::pair. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_31@156672 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Parse/ParseDecl.cpp | 6 ++++++ test/CXX/expr/expr.prim/expr.prim.general/p3-0x.cpp | 5 +++-- test/SemaCXX/dependent-noexcept-unevaluated.cpp | 3 +-- test/SemaCXX/implicit-exception-spec.cpp | 7 +++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 932ffb440f..d8e8c5f56e 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -4266,10 +4266,16 @@ 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()); +#else + const bool Delayed = false; +#endif ESpecType = tryParseExceptionSpecification(Delayed, ESpecRange, DynamicExceptions, 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 ad4f4064c2..030c90c525 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 fad8d0918d..0a3a8bb250 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(), declval()))); + void swap(array& a) noexcept(noexcept(swap(declval(), declval()))); }; struct DefaultOnly @@ -38,4 +38,3 @@ int main() { array a, b; } - diff --git a/test/SemaCXX/implicit-exception-spec.cpp b/test/SemaCXX/implicit-exception-spec.cpp index 143d9f7cc8..ec853c504a 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; }; } -- cgit v1.2.3