[PATCH] D146842: [clang-tidy] Fix crash when handling invalid config values

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 24 13:00:39 PDT 2023


PiotrZSL created this revision.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
PiotrZSL requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Currently due to missing DiagnosticsEngine when invalid
enum config value is passed to check, and --dump-config
is used, clang-tidy would crash. This change fixes this
and extends --verify-config command to actually verify
those invalid enum values instead of ignoring them and
printing that 'No config errors detected.'.

Fixes:

- https://github.com/llvm/llvm-project/issues/50876


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146842

Files:
  clang-tools-extra/clang-tidy/ClangTidy.cpp
  clang-tools-extra/clang-tidy/ClangTidy.h
  clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp
  clang-tools-extra/test/clang-tidy/infrastructure/invalid-enum-config-value.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146842.508201.patch
Type: text/x-patch
Size: 6450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230324/e805427d/attachment.bin>


More information about the cfe-commits mailing list