}
else if (!extended)
{
- if (cxx_dialect < cxx23)
- pedwarn (input_location, OPT_Wpedantic,
+ if (cxx_dialect < cxx23 && pedantic)
+ pedwarn (input_location, OPT_Wc__23_extensions,
"%<f%d%> or %<F%d%> suffix on floating constant only "
"available with %<-std=c++2b%> or %<-std=gnu++2b%>",
n, n);
if (!c_dialect_cxx ())
pedwarn (input_location, OPT_Wpedantic,
"non-standard suffix on floating constant");
- else if (cxx_dialect < cxx23)
- pedwarn (input_location, OPT_Wpedantic,
+ else if (cxx_dialect < cxx23 && pedantic)
+ pedwarn (input_location, OPT_Wc__23_extensions,
"%<bf16%> or %<BF16%> suffix on floating constant only "
"available with %<-std=c++2b%> or %<-std=gnu++2b%>");
}
unsigned int option_index = find_opt (data.option_str + 1, lang_mask);
if (early && !(c_option_is_from_cpp_diagnostics (option_index)
+ /* For interpret_float. */
+ || option_index == OPT_Wc__23_extensions
|| option_index == OPT_Wunknown_pragmas))
return;
error_at (token->location,
"use of %<auto%> in template argument");
else if (!flag_concepts)
- pedwarn (token->location, 0,
+ pedwarn (token->location, OPT_Wc__20_extensions,
"use of %<auto%> in parameter declaration "
"only available with %<-std=c++20%> or %<-fconcepts%>");
else if (cxx_dialect < cxx14)
;
else if (storage == ridpointers[(int) RID_EXTERN])
{
- if (cxx_dialect == cxx98)
- pedwarn (input_location, OPT_Wpedantic,
+ if (cxx_dialect == cxx98 && pedantic)
+ pedwarn (input_location, OPT_Wc__11_extensions,
"ISO C++ 1998 forbids the use of %<extern%> on explicit "
"instantiations");
extern_p = 1;
{
if (storage == ridpointers[(int) RID_EXTERN])
{
- if (cxx_dialect == cxx98)
- pedwarn (input_location, OPT_Wpedantic,
+ if (cxx_dialect == cxx98 && pedantic)
+ pedwarn (input_location, OPT_Wc__11_extensions,
"ISO C++ 1998 forbids the use of %<extern%> on "
"explicit instantiations");
}
--- /dev/null
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++11-extensions"
+
+template <class T> struct A
+{
+ void f() { }
+};
+
+extern template class A<int>;
+extern template void A<char>::f();
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++23-extensions"
+
+#ifdef __STDCPP_FLOAT16_T__
+auto x16 = 3.14f16;
+#endif
+#ifdef __STDCPP_FLOAT32_T__
+auto x32 = 3.14f32;
+#endif
+#ifdef __STDCPP_FLOAT64_T__
+auto x64 = 3.14f64;
+#endif
+#ifdef __STDCPP_FLOAT128_T__
+auto x128 = 3.14f128;
+#endif
+#ifdef __STDCPP_FLOAT16_T__
+auto xbf = 1.2bf16;
+#endif
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wc++20-extensions"
+
+void f(auto p) { }