Skip to content
Commit 7c002192 authored by Jorge Pinto Sousa's avatar Jorge Pinto Sousa Committed by Aaron Ballman
Browse files

[clang] trigger -Wcast-qual on functional casts

-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.

Fixes https://github.com/llvm/llvm-project/issues/62083
Differential Revision: https://reviews.llvm.org/D148276
parent 5368c106
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment