c++: robustify testcase [PR109752]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / feat-cxx98-neg.C
blobd76a1e2617d2a2c500b565e45e9277c115a9dddd
1 // { dg-do compile { target c++98_only } }
3 //  C++11 features:
5 #ifndef __cpp_runtime_arrays
6 #  error "__cpp_runtime_arrays" // { dg-error "error" }
7 #endif
9 #ifndef __cpp_unicode_characters
10 #  error "__cpp_unicode_characters" // { dg-error "error" }
11 #endif
13 #ifndef __cpp_raw_strings
14 #  error "__cpp_raw_strings" // { dg-error "error" }
15 #endif
17 #ifndef __cpp_unicode_literals
18 #  error "__cpp_unicode_literals" // { dg-error "error" }
19 #endif
21 #ifndef __cpp_user_defined_literals
22 #  error "__cpp_user_defined_literals" // { dg-error "error" }
23 #endif
25 #ifndef __cpp_lambdas
26 #  error "__cpp_lambdas" // { dg-error "error" }
27 #endif
29 #ifndef __cpp_constexpr
30 #  error "__cpp_constexpr" // { dg-error "error" }
31 #endif
33 #ifndef __cpp_static_assert
34 #  error "__cpp_static_assert" // { dg-error "error" }
35 #endif
37 #ifndef __cpp_decltype
38 #  error "__cpp_decltype" // { dg-error "error" }
39 #endif
41 #ifndef __cpp_attributes
42 #  error "__cpp_attributes" // { dg-error "error" }
43 #endif
45 #ifndef __cpp_rvalue_references
46 #  error "__cpp_rvalue_references" // { dg-error "error" }
47 #endif
49 #ifndef __cpp_variadic_templates
50 #  error "__cpp_variadic_templates" // { dg-error "error" }
51 #endif
53 #ifndef __cpp_initializer_lists
54 #  error "__cpp_initializer_lists" // { dg-error "error" }
55 #endif
57 #ifndef __cpp_delegating_constructors
58 #  error "__cpp_delegating_constructors" // { dg-error "error" }
59 #endif
61 #ifndef __cpp_nsdmi
62 #  error "__cpp_nsdmi" // { dg-error "error" }
63 #endif
65 #ifndef __cpp_inheriting_constructors
66 #  error "__cpp_inheriting_constructors" // { dg-error "error" }
67 #endif
69 #ifndef __cpp_ref_qualifiers
70 #  error "__cpp_ref_qualifiers" // { dg-error "error" }
71 #endif
73 #ifndef __cpp_alias_templates
74 #  error "__cpp_alias_templates" // { dg-error "error" }
75 #endif
77 // C++14 features:
79 // C++98 gets binary literals in non-ANSI modes.
80 //#ifndef __cpp_binary_literals
81 //#  error "__cpp_binary_literals"
82 //#endif
84 #ifndef __cpp_init_captures
85 #  error "__cpp_init_captures" // { dg-error "error" }
86 #endif
88 #ifndef __cpp_generic_lambdas
89 #  error "__cpp_generic_lambdas" // { dg-error "error" }
90 #endif
92 #ifndef __cpp_decltype_auto
93 #  error "__cpp_decltype_auto" // { dg-error "error" }
94 #endif
96 #ifndef __cpp_return_type_deduction
97 #  error "__cpp_return_type_deduction" // { dg-error "error" }
98 #endif
100 #ifndef __cpp_aggregate_nsdmi
101 #  error "__cpp_aggregate_nsdmi" // { dg-error "error" }
102 #endif
104 #ifndef __cpp_variable_templates
105 #  error "__cpp_variable_templates" // { dg-error "error" }
106 #endif
108 #ifndef __cpp_digit_separators
109 #  error "__cpp_digit_separators" // { dg-error "error" }
110 #endif
112 #ifndef __cpp_sized_deallocation
113 #  error "__cpp_sized_deallocation" // { dg-error "error" }
114 #endif
116 // C++17 features:
118 #ifndef __cpp_namespace_attributes
119 #  error "__cpp_namespace_attributes" // { dg-error "error" }
120 #endif
122 #ifndef __cpp_nested_namespace_definitions
123 #  error "__cpp_nested_namespace_definitions" // { dg-error "error" }
124 #endif
126 //  C++11 attributes:
128 #ifdef __has_cpp_attribute
129 #  if __has_cpp_attribute(noreturn) == 200809
130 #    error "__has_cpp_attribute(noreturn) == 200809" // { dg-error "error" }
131 #  endif
132 #else
133 #  error "__has_cpp_attribute"
134 #endif
136 //  Attribute carries_dependency not in yet.
137 //#ifdef __has_cpp_attribute
138 //#  if __has_cpp_attribute(carries_dependency) == 200809
139 //#    error "__has_cpp_attribute(carries_dependency) == 200809" // {  }
140 //#  endif
141 //#else
142 //#  error "__has_cpp_attribute"
143 //#endif
145 //  C++14 attributes:
147 //  Attribute [[deprecated]] is allowed in C++11 as an extension.
148 //#ifdef __has_cpp_attribute
149 //#  if __has_cpp_attribute(deprecated) == 201309
150 //#    error "__has_cpp_attribute(deprecated)" // {  }
151 //#  endif
152 //#else
153 //#  error "__has_cpp_attribute"
154 //#endif