[clang-tools-extra] [clang-tidy] Add portability-avoid-platform-specific-fundamental-types (PR #146970)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Sat Jul 12 15:53:18 PDT 2025


================
@@ -0,0 +1,254 @@
+//===--- AvoidPlatformSpecificFundamentalTypesCheck.cpp - clang-tidy ------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "AvoidPlatformSpecificFundamentalTypesCheck.h"
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/Type.h"
+#include "clang/ASTMatchers/ASTMatchFinder.h"
+#include "clang/ASTMatchers/ASTMatchers.h"
+#include "clang/Basic/TargetInfo.h"
+
+using namespace clang::ast_matchers;
+
+namespace {
+
+static bool isCharType(const clang::BuiltinType *BT) {
----------------
5chmidti wrote:

This function * `isBuiltinChar`: please use the existing `isAnyCharacter` matcher. Though that one also matches wide character types

https://github.com/llvm/llvm-project/pull/146970


More information about the cfe-commits mailing list