exception-spec-crash.cpp 771 B

123456789101112131415161718192021222324252627282930
  1. // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
  2. // RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -DCXX_EXCEPTIONS -fsyntax-only -verify %s
  3. template <class _Tp> struct is_nothrow_move_constructible {
  4. static const bool value = false;
  5. };
  6. template <class _Tp>
  7. class allocator;
  8. template <>
  9. class allocator<char> {};
  10. template <class _Allocator>
  11. class basic_string {
  12. typedef _Allocator allocator_type;
  13. basic_string(basic_string &&__str)
  14. noexcept(is_nothrow_move_constructible<allocator_type>::value);
  15. };
  16. class Foo {
  17. Foo(Foo &&) noexcept = default;
  18. #ifdef CXX_EXCEPTIONS
  19. // expected-error@-2 {{does not match the calculated}}
  20. #else
  21. // expected-no-diagnostics
  22. #endif
  23. Foo &operator=(Foo &&) noexcept = default;
  24. basic_string<allocator<char> > vectorFoo_;
  25. };