================
@@ -2961,6 +2961,10 @@ def err_for_range_decl_must_be_var : Error<
def err_for_range_storage_class : Error<
"%select{loop|expansion}0 variable %1 may not be declared
%select{'extern'|'static'|"
"'__private_extern__'|'auto'|'register'|'constexpr'|'thread_local'}2">;
+def err_for_range_constexpr_loop_var : Error<
+ "constexpr variable %0 must be initialized by a constant expression; "
+ "a range-based for loop variable is initialized on each iteration from the "
+ "loop's iterator, whose value is not known at compile time">;
----------------
Fznamznon wrote:
If we go that way IMO that should be a note in addition to existing
`err_constexpr_var_requires_const_init` instead fully copy-paste of an existing
message with additional test.
https://github.com/llvm/llvm-project/pull/218145
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits