[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / g++.dg / wrappers / cp-stdlib.C
blobd29585f48a31480ccaa43ca7c900103bc10961cc
1 /* At one time this triggered ICEs with location wrapper nodes,
2    apparently requiring error-recovery (hence the various syntax
3    errors in this file.  */
5 // { dg-excess-errors "expected to be full of errors, but not an ICE" }
7 namespace std
9   inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
11 namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
13   template<typename _Tp>
14     class new_allocator
15     {
16       typedef _Tp value_type;
17     };
19 namespace std
21   template<typename _Tp>
22     using __allocator_base = __gnu_cxx::new_allocator<_Tp>;
24 namespace std __attribute__ ((__visibility__ ("default")))
26     {
27     };
28   template<typename _Tp>
29     class allocator : public __allocator_base<_Tp>
30     {
31     };
32   template<typename _Alloc>
33     struct allocator_traits : __allocator_traits_base
34     {
35     };
36   template<typename _Tp>
37     struct allocator_traits<allocator<_Tp>>
38     {
39       using allocator_type = allocator<_Tp>;
40       template<typename _Up>
41  using rebind_alloc = allocator<_Up>;
42       allocate(allocator_type& __a, size_type __n)
43     };
45 namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
47 template<typename _Alloc, typename = typename _Alloc::value_type>
48   struct __alloc_traits
49   : std::allocator_traits<_Alloc>
50   {
51     typedef std::allocator_traits<_Alloc> _Base_type;
52     template<typename _Tp>
53       struct rebind
54       { typedef typename _Base_type::template rebind_alloc<_Tp> other; };
55   };
57     {
58  }
59  }
60     }
61     {
62  {
63     }
65 namespace std __attribute__ ((__visibility__ ("default")))
67     struct char_traits;
68 namespace __cxx11 {
69   template<typename _CharT, typename _Traits = char_traits<_CharT>,
70            typename _Alloc = allocator<_CharT> >
71     class basic_string;
72     }
74 namespace std __attribute__ ((__visibility__ ("default")))
76 namespace __cxx11 {
77   template<typename _CharT, typename _Traits, typename _Alloc>
78     class basic_string
79     {
80       typedef typename __gnu_cxx::__alloc_traits<_Alloc>::template
81  rebind<_CharT>::other _Char_alloc_type;
82       typedef __gnu_cxx::__alloc_traits<_Char_alloc_type> _Alloc_traits;
83     public:
84       {
85    {
86    }
87       }
88       operator=(const basic_string& __str)
89       {
90    {
91        {
92     {
93       const auto __len = __str.size();
94       auto __alloc = __str._M_get_allocator();
95       auto __ptr = _Alloc_traits::allocate(__alloc, __len + 1);
96     }
97        }
98    }
99       }
100       {
101       }
102       size() const noexcept
103      }
104 namespace filesystem
106   class path
107   {
108     typedef char value_type;
109     typedef std::basic_string<value_type> string_type;
110       {
111     }
112     string_type _M_pathname;
113   };
114   class directory_entry
115   {
116     void assign(const filesystem::path& __p) { _M_path = __p; }
117     filesystem::path _M_path;