-
Notifications
You must be signed in to change notification settings - Fork 17.5k
[clang] New static_assert message is sometimes redundant #57906
Copy link
Copy link
Closed
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featuregood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Metadata
Metadata
Assignees
Labels
clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerenhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featuregood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contribute
Type
Fields
Give feedbackNo fields configured for issues without a type.
The new
static_assertmessage is great, there are some simple messages where an expansion isn't particularly helpful.For example
will give us
The note isn't necessary, since the error implies that the expression will be
false or false. I noticed that if we change the expression to a conjunction, we get a simpler message, so it looks like the machinery might already be present.We should---on a best effort basis---aim to eliminate expansions that don't add value to minimise user frustration (this will give us slightly more room to have longer diagnostics elsewhere).