[PATCH] D13784: [clang-tidy] add check cppcoreguidelines-pro-type-union-access

Samuel Benzaquen via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 16 10:18:13 PDT 2015


sbenza added inline comments.

================
Comment at: clang-tidy/cppcoreguidelines/ProTypeUnionAccessCheck.cpp:20
@@ +19,3 @@
+void ProTypeUnionAccessCheck::registerMatchers(MatchFinder *Finder) {
+  Finder->addMatcher(memberExpr(hasObjectExpression(hasType(recordDecl(isUnion())))).bind("expr"), this);
+}
----------------
This should check that we are in C++ code.

  if (!getLangOpts().CPlusPlus)
    return;


http://reviews.llvm.org/D13784





More information about the cfe-commits mailing list