[PATCH] D148276: [clang] trigger -Wcast-qual on functional casts

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 21 10:32:09 PDT 2023


aaron.ballman added a comment.

In D148276#4287900 <https://reviews.llvm.org/D148276#4287900>, @thurston wrote:

> I think this change is triggering an error on a buildbot (https://lab.llvm.org/buildbot/#/builders/37/builds/21631/steps/20/logs/stdio):
>
>   /b/sanitizer-x86_64-linux/build/llvm-project/clang/lib/Analysis/UnsafeBufferUsage.cpp:1348:45: error: cast from 'const clang::ASTContext' to 'clang::ASTContext &' drops const qualifier [-Werror,-Wcast-qual]
>             std::remove_const_t<ASTContext &>(Ctx),
>
> even though the code is deliberately trying to remove the const qualifier the right (?) way.

Ouch, that's pretty sad. I'll work around it and land a fix shortly, thank you for pointing this out!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148276/new/

https://reviews.llvm.org/D148276



More information about the cfe-commits mailing list