[clang] [RFC] Initial implementation of P2719 (PR #113510)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 25 13:39:24 PDT 2025
================
@@ -9817,27 +9817,54 @@ def err_operator_new_delete_invalid_result_type : Error<
def err_operator_new_delete_dependent_result_type : Error<
"%0 cannot have a dependent return type; use %1 instead">;
def err_operator_new_delete_too_few_parameters : Error<
- "%0 must have at least one parameter">;
+ "%select{|type aware }0%select{|destroying }1%2 must have at least %select{|one|two|three|four|five}3 parameter%s3">;
def err_operator_new_delete_template_too_few_parameters : Error<
"%0 template must have at least two parameters">;
def warn_operator_new_returns_null : Warning<
"%0 should not return a null pointer unless it is declared 'throw()'"
"%select{| or 'noexcept'}1">, InGroup<OperatorNewReturnsNull>;
def err_operator_new_dependent_param_type : Error<
- "%0 cannot take a dependent type as first parameter; "
- "use size_t (%1) instead">;
+ "%select{|type aware }0%select{|destroying }1%2 cannot take a dependent type as its %select{first|second|third|fourth|fifth}3 parameter; "
----------------
cor3ntin wrote:
I would either
* say which parameter we are talking about ("its alignment parameter" or some such)
* say 'only the type-identity parameter of a type aware allocation function can be dependent"
The important part is that diag points to the correct parameter, I don't want to have to count them.
https://github.com/llvm/llvm-project/pull/113510
More information about the cfe-commits
mailing list