-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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 feature
Description
-Wcast-qual
does not trigger on the following code in Clang, but does in GCC.
const auto i = 42;
using T = int*;
auto p = T(&i);
The expected behavior is that a functional cast should trigger the warning the same as the equivalent C cast because the meaning is the same, and nothing about the functional cast makes it easier to recognize that a const_cast is occurring (in fact I would argue it is the opposite) so the same rationale should apply.
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 feature