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/trunk@155975
91177308-0d34-0410-b5e6-
96231b3b80d8
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,
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}}
- };
-}
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}}
};
}
{
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
{
array<DefaultOnly, 1> a, b;
}
-
}
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;
};
}