xref: /llvm-project/clang/test/SemaTemplate/exception-spec-crash.cpp (revision 2b45b267dab44442dbe68708be54e7d85e1b04dd)
19b2c5e7cSRichard Smith // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s -Wno-defaulted-function-deleted
29b2c5e7cSRichard Smith // RUN: %clang_cc1 -std=c++11 -fcxx-exceptions -DCXX_EXCEPTIONS -fsyntax-only -verify %s -Wno-defaulted-function-deleted
3*2b45b267SRichard Smith // expected-no-diagnostics
4ae3a944aSAlp Toker 
5ae3a944aSAlp Toker template <class _Tp> struct is_nothrow_move_constructible {
6ae3a944aSAlp Toker   static const bool value = false;
7ae3a944aSAlp Toker };
8ae3a944aSAlp Toker 
9ae3a944aSAlp Toker template <class _Tp>
10ae3a944aSAlp Toker class allocator;
11ae3a944aSAlp Toker 
12ae3a944aSAlp Toker template <>
13ae3a944aSAlp Toker class allocator<char> {};
14ae3a944aSAlp Toker 
15ae3a944aSAlp Toker template <class _Allocator>
16ae3a944aSAlp Toker class basic_string {
17ae3a944aSAlp Toker   typedef _Allocator allocator_type;
18ae3a944aSAlp Toker   basic_string(basic_string &&__str)
19ae3a944aSAlp Toker   noexcept(is_nothrow_move_constructible<allocator_type>::value);
20ae3a944aSAlp Toker };
21ae3a944aSAlp Toker 
22ae3a944aSAlp Toker class Foo {
23ae3a944aSAlp Toker   Foo(Foo &&) noexcept = default;
24ae3a944aSAlp Toker   Foo &operator=(Foo &&) noexcept = default;
25ae3a944aSAlp Toker   basic_string<allocator<char> > vectorFoo_;
26ae3a944aSAlp Toker };
27