[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CXX / except / except.spec / canonical.cpp
blobd6dc258892050fff5a8d104776f5f36180552eff
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
2 // expected-no-diagnostics
4 // PR10087: Make sure that we don't conflate exception specifications
5 // from different functions in the canonical type system.
6 namespace std
9 template <class _Tp> _Tp&& declval() noexcept;
11 template <class _Tp, class... _Args>
12 struct _is_nothrow_constructible
14 static const bool value = noexcept(_Tp(declval<_Args>()...));
17 template<class, class _Traits, class _Allocator>
18 class basic_string
20 public:
21 typedef typename _Traits::char_type value_type;
22 typedef _Allocator allocator_type;
24 basic_string()
25 noexcept(_is_nothrow_constructible<allocator_type>::value);
28 template <class, class, class _Compare>
29 struct __map_value_compare
31 public:
32 __map_value_compare()
33 noexcept(_is_nothrow_constructible<_Compare>::value);
36 struct less
40 struct map
42 typedef __map_value_compare<int, short, less> __vc;
43 __vc vc_;
47 template<class T, class _Traits, class _Allocator>
48 basic_string<T, _Traits, _Allocator>::basic_string() noexcept(_is_nothrow_constructible<allocator_type>::value) {}
50 template <class T, class Value, class _Compare>
51 __map_value_compare<T, Value, _Compare>::__map_value_compare()
52 noexcept(_is_nothrow_constructible<_Compare>::value) {}
54 } // std