[PATCH] D88445: Use "default member initializer" instead of "in-class initializer" for diagnostics
Richard Smith - zygoloid via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 28 14:19:06 PDT 2020
rsmith added a comment.
Thanks!
================
Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:864-867
+ "default member initialization of non-static data member is a C++11 "
+ "extension">, InGroup<CXX11>;
def warn_cxx98_compat_nonstatic_member_init : Warning<
+ "default member initialization of non-static data members is incompatible "
----------------
Consider "initialization of" -> "initializer for", so we use the standard term in full.
================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8506-8524
+def err_default_member_initializer_non_const : Error<
"non-const static data member must be initialized out of line">;
-def err_in_class_initializer_volatile : Error<
+def err_default_member_initializer_volatile : Error<
"static const volatile data member must be initialized out of line">;
-def err_in_class_initializer_bad_type : Error<
+def err_default_member_initializer_bad_type : Error<
"static data member of type %0 must be initialized out of line">;
+def ext_default_member_initializer_float_type : ExtWarn<
----------------
For a static member, it's just an initializer, not a default member initializer. I think "in-class initializer" is probably the best we can say here.
================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:8533-8536
+def ext_default_member_initializer_non_constant : Extension<
+ "default member initializer for static data member is not a constant "
+ "expression; folding it to a constant is a GNU extension">,
+ InGroup<GNUFoldingConstant>;
----------------
Likewise, this case is an initializer for a static member, and is not a default member initializer.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88445/new/
https://reviews.llvm.org/D88445
More information about the cfe-commits
mailing list