@@ -2343,18 +2343,18 @@ def warn_cxx14_compat_constexpr_not_const : Warning<
23432343 "in C++14; add 'const' to avoid a change in behavior">,
23442344 InGroup<DiagGroup<"constexpr-not-const">>;
23452345def err_invalid_constexpr : Error<
2346- "%select{function parameter|typedef|non-static data member }0 "
2347- "cannot be %select{constexpr|consteval }1">;
2346+ "%select{function parameter|typedef}0 "
2347+ "cannot be %sub{select_constexpr_spec_kind }1">;
23482348def err_invalid_constexpr_member : Error<"non-static data member cannot be "
23492349 "constexpr%select{; did you intend to make it %select{const|static}0?|}1">;
23502350def err_constexpr_tag : Error<
23512351 "%select{class|struct|interface|union|enum}0 "
2352- "cannot be marked %select{constexpr|consteval }1">;
2352+ "cannot be marked %sub{select_constexpr_spec_kind }1">;
23532353def err_constexpr_dtor : Error<
2354- "destructor cannot be marked %select{constexpr|consteval }0">;
2354+ "destructor cannot be marked %sub{select_constexpr_spec_kind }0">;
23552355def err_constexpr_wrong_decl_kind : Error<
2356- "%select{constexpr|consteval }0 can only be used "
2357- "in %select{variable and |}0function declarations">;
2356+ "%sub{select_constexpr_spec_kind }0 can only be used "
2357+ "in %select{| variable and function|function|variable}0 declarations">;
23582358def err_invalid_constexpr_var_decl : Error<
23592359 "constexpr variable declaration must be a definition">;
23602360def err_constexpr_static_mem_var_requires_init : Error<
@@ -7514,10 +7514,30 @@ def note_inequality_comparison_to_or_assign : Note<
75147514def err_incomplete_type_used_in_type_trait_expr : Error<
75157515 "incomplete type %0 used in type trait expression">;
75167516
7517+ // C++20 constinit and require_constant_initialization attribute
7518+ def warn_cxx20_compat_constinit : Warning<
7519+ "'constinit' specifier is incompatible with C++ standards before C++20">,
7520+ InGroup<CXX2aCompat>, DefaultIgnore;
7521+ def err_constinit_local_variable : Error<
7522+ "local variable cannot be declared 'constinit'">;
75177523def err_require_constant_init_failed : Error<
75187524 "variable does not have a constant initializer">;
75197525def note_declared_required_constant_init_here : Note<
7520- "required by 'require_constant_initialization' attribute here">;
7526+ "required by %select{'require_constant_initialization' attribute|"
7527+ "'constinit' specifier}0 here">;
7528+ def ext_constinit_missing : ExtWarn<
7529+ "'constinit' specifier missing on initializing declaration of %0">,
7530+ InGroup<DiagGroup<"missing-constinit">>;
7531+ def note_constinit_specified_here : Note<"variable declared constinit here">;
7532+ def err_constinit_added_too_late : Error<
7533+ "'constinit' specifier added after initialization of variable">;
7534+ def warn_require_const_init_added_too_late : Warning<
7535+ "'require_constant_initialization' attribute added after initialization "
7536+ "of variable">, InGroup<IgnoredAttributes>;
7537+ def note_constinit_missing_here : Note<
7538+ "add the "
7539+ "%select{'require_constant_initialization' attribute|'constinit' specifier}0 "
7540+ "to the initializing declaration here">;
75217541
75227542def err_dimension_expr_not_constant_integer : Error<
75237543 "dimension expression does not evaluate to a constant unsigned int">;
0 commit comments