================
@@ -14,13 +14,42 @@ using namespace clang::ast_matchers;
 
 namespace clang::tidy::cppcoreguidelines {
 
+static bool hasConstQualifier(QualType Type) {
+  const QualType PtrType = Type->getPointeeType();
+  if (!PtrType.isNull())
+    return hasConstQualifier(PtrType);
+
+  return Type.isConstQualified();
----------------
HerrCai0907 wrote:

In cppreference, `const_cast` means converting between types with different 
cv-qualification.
So `isConstQualified` is not enough, `isVolatileQualified` is also needed.

https://github.com/llvm/llvm-project/pull/69501
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to