[PATCH] D128157: [clang-tidy] cppcoreguidelines-virtual-class-destructor: Fix crash when "virtual" keyword is expanded from a macro

Richard via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 24 11:17:57 PDT 2022


LegalizeAdulthood requested changes to this revision.
LegalizeAdulthood added a comment.
This revision now requires changes to proceed.

I get a test failure when I run with your change:

    -- Testing: 972 tests, 12 workers --
    FAIL: Clang Tools :: clang-apply-replacements/basic.cpp (680 of 972)
    ******************** TEST 'Clang Tools :: clang-apply-replacements/basic.cpp' FAILED ********************
    Script:
    --
    : 'RUN: at line 1';   mkdir -p D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic
    : 'RUN: at line 2';   grep -Ev "// *[A-Z-]+:" D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements/Inputs/basic/basic.h > D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic/basic.h
    : 'RUN: at line 3';   sed "s#\$(path)#D:/legalize/llvm/llvm-project/build/tools/clang/tools/extra/test/clang-apply-replacements/Output/Inputs/basic#" D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements/Inputs/basic/file1.yaml > D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic/file1.yaml
    : 'RUN: at line 4';   sed "s#\$(path)#D:/legalize/llvm/llvm-project/build/tools/clang/tools/extra/test/clang-apply-replacements/Output/Inputs/basic#" D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements/Inputs/basic/file2.yaml > D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic/file2.yaml
    : 'RUN: at line 5';   clang-apply-replacements D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic
    : 'RUN: at line 6';   FileCheck -input-file=D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic/basic.h D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements/Inputs/basic/basic.h
    : 'RUN: at line 9';   ls -1 D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic | FileCheck D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements\basic.cpp --check-prefix=YAML
    : 'RUN: at line 12';   grep -Ev "// *[A-Z-]+:" D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements/Inputs/basic/basic.h > D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic/basic.h
    : 'RUN: at line 13';   clang-apply-replacements -remove-change-desc-files D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic
    : 'RUN: at line 14';   ls -1 D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic | FileCheck D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements\basic.cpp --check-prefix=NO_YAML
    --
    Exit Code: 1
  
    Command Output (stdout):
    --
    $ ":" "RUN: at line 1"
    $ "mkdir" "-p" "D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic"
    $ ":" "RUN: at line 2"
    $ "grep" "-Ev" "// *[A-Z-]+:" "D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements/Inputs/basic/basic.h"
    $ ":" "RUN: at line 3"
    $ "sed" "s#\$(path)#D:/legalize/llvm/llvm-project/build/tools/clang/tools/extra/test/clang-apply-replacements/Output/Inputs/basic#" "D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements/Inputs/basic/file1.yaml"
    $ ":" "RUN: at line 4"
    $ "sed" "s#\$(path)#D:/legalize/llvm/llvm-project/build/tools/clang/tools/extra/test/clang-apply-replacements/Output/Inputs/basic#" "D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements/Inputs/basic/file2.yaml"
    $ ":" "RUN: at line 5"
    $ "clang-apply-replacements" "D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic"
    $ ":" "RUN: at line 6"
    $ "FileCheck" "-input-file=D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic/basic.h" "D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements/Inputs/basic/basic.h"
    $ ":" "RUN: at line 9"
    $ "ls" "-1" "D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic"
    $ "FileCheck" "D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements\basic.cpp" "--check-prefix=YAML"
    $ ":" "RUN: at line 12"
    $ "grep" "-Ev" "// *[A-Z-]+:" "D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements/Inputs/basic/basic.h"
    $ ":" "RUN: at line 13"
    $ "clang-apply-replacements" "-remove-change-desc-files" "D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic"
    $ ":" "RUN: at line 14"
    $ "ls" "-1" "D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\clang-apply-replacements\Output/Inputs/basic"
    $ "FileCheck" "D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements\basic.cpp" "--check-prefix=NO_YAML"
    # command stderr:
  D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements\basic.cpp(17,17): error G8807F445: NO_YAML-NOT: excluded string found in input [D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\check-clang-extra.vcxproj]
    // NO_YAML-NOT: {{^file.\.yaml$}}
                    ^
    <stdin>:2:1: note: found here
    file1.yaml
    ^~~~~~~~~~
  
    Input file: <stdin>
    Check file: D:\legalize\llvm\llvm-project\clang-tools-extra\test\clang-apply-replacements\basic.cpp
  
    -dump-input=help explains the following input dump.
  
    Input was:
    <<<<<<
            1: basic.h
            2: file1.yaml
  not : 17     !~~~~~~~~~ error : no match expected [D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\check-clang-extra.vcxproj]
    >>>>>>
  
  CUSTOMBUILD : error : command failed with exit status: 1 [D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\check-clang-extra.vcxproj]
  
    --
  
    ********************
    ********************
    Failed Tests (1):
      Clang Tools :: clang-apply-replacements/basic.cpp
  
  
    Testing Time: 707.23s
      Unsupported      :   11
      Passed           : 1983
      Expectedly Failed:    2
      Failed           :    1
  C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(245,5): error MSB8066: Custom build for 'D:\legalize\llvm\llvm-project\build\CMakeFiles\5761a0d8e5ced254ad62b101e70e3dea\check-clang-extra.rule' exited with code 1. [D:\legalize\llvm\llvm-project\build\tools\clang\tools\extra\test\check-clang-extra.vcxproj]

If I revert your change, then the tests pass....  can you take a look?  Build the CMake target `check-clang-extra`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128157



More information about the cfe-commits mailing list