The paper which introduced indeterminate attribute has not added a value
for __has_cpp_attribute, so I've missed it and didn't add it to
c_common_has_attribute. Later CWG issue fixed this up.
2026-07-20 Jakub Jelinek <jakub@redhat.com>
PR c++/126309
* c-lex.cc: Implement CWG3020 - Missing specification for
__has_cpp_attribute(indeterminate).
(c_common_has_attribute): Handle __has_cpp_attribute (indeterminate).
* g++.dg/cpp26/feat-cxx26.C: Test __has_cpp_attribute (indeterminate).
* g++.dg/cpp29/feat-cxx29.C: Likewise.
Reviewed-by: Jason Merrill <jason@redhat.com>
result = 201907;
else if (is_attribute_p ("assume", attr_name))
result = 202207;
+ else if (is_attribute_p ("indeterminate", attr_name))
+ result = 202403;
else if (is_attribute_p ("init_priority", attr_name))
{
/* The (non-standard) init_priority attribute is always
#elif __cpp_trivial_union != 202502
# error "__cpp_trivial_union != 202502"
#endif
+
+// C++26 attributes:
+
+#ifdef __has_cpp_attribute
+# if ! __has_cpp_attribute(indeterminate)
+# error "__has_cpp_attribute(indeterminate)"
+# elif __has_cpp_attribute(indeterminate) != 202403
+# error "__has_cpp_attribute(indeterminate) != 202403"
+# endif
+#else
+# error "__has_cpp_attribute"
+#endif
#elif __cpp_trivial_union != 202502
# error "__cpp_trivial_union != 202502"
#endif
+
+// C++26 attributes:
+
+#ifdef __has_cpp_attribute
+# if ! __has_cpp_attribute(indeterminate)
+# error "__has_cpp_attribute(indeterminate)"
+# elif __has_cpp_attribute(indeterminate) != 202403
+# error "__has_cpp_attribute(indeterminate) != 202403"
+# endif
+#else
+# error "__has_cpp_attribute"
+#endif