[PATCH] D134813: Properly print unnamed TagDecl objects in diagnostics

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 13:45:40 PDT 2022


aaron.ballman added a comment.

In D134813#3834710 <https://reviews.llvm.org/D134813#3834710>, @sammccall wrote:

> In D134813#3834613 <https://reviews.llvm.org/D134813#3834613>, @sammccall wrote:
>
>> Changing USR generation to not rely on this detail seems easier, I can take a stab at this.
>
> Seems trivial: https://reviews.llvm.org/D135191
> If there are still diffs in USR tests after rebasing on that, I'm happy to take a look at them.

Thank you for this! I applied D135191 <https://reviews.llvm.org/D135191> over the top of my changes here and ran the tests to get all the new failures with the changes, then I reverted those tests which failed back to their trunk form. When I re-ran the tests, I get the following failures:

  F:\source\llvm-project>python llvm\out\build\x64-Debug\bin\llvm-lit.py -sv -j61 clang\test\
  llvm-lit.py: F:\source\llvm-project\llvm\utils\lit\lit\llvm\config.py:46: note: using lit tools: C:\GnuWin32\bin
  llvm-lit.py: F:\source\llvm-project\llvm\utils\lit\lit\llvm\config.py:456: note: using clang: f:\source\llvm-project\llvm\out\build\x64-debug\bin\clang.exe
  llvm-lit.py: F:\source\llvm-project\llvm\utils\lit\lit\discovery.py:247: warning: test suite 'Clang-Unit' contained no tests
  -- Testing: 15539 tests, 61 workers --
  Testing:
  FAIL: Clang :: Index/usrs.m (1 of 15539)
  ******************** TEST 'Clang :: Index/usrs.m' FAILED ********************
  Script:
  --
  : 'RUN: at line 103';   f:\source\llvm-project\llvm\out\build\x64-debug\bin\c-index-test.exe -test-load-source-usrs all -target x86_64-apple-macosx10.7 F:\source\llvm-project\clang\test\Index\usrs.m -isystem F:\source\llvm-project\clang\test\Index/Inputs | f:\source\llvm-project\llvm\out\build\x64-debug\bin\filecheck.exe F:\source\llvm-project\clang\test\Index\usrs.m
  : 'RUN: at line 173';   f:\source\llvm-project\llvm\out\build\x64-debug\bin\c-index-test.exe -test-load-source all F:\source\llvm-project\clang\test\Index\usrs.m -isystem F:\source\llvm-project\clang\test\Index/Inputs | f:\source\llvm-project\llvm\out\build\x64-debug\bin\filecheck.exe -check-prefix=CHECK-source F:\source\llvm-project\clang\test\Index\usrs.m
  --
  Exit Code: 1
  
  Command Output (stdout):
  --
  $ ":" "RUN: at line 103"
  $ "f:\source\llvm-project\llvm\out\build\x64-debug\bin\c-index-test.exe" "-test-load-source-usrs" "all" "-target" "x86_64-apple-macosx10.7" "F:\source\llvm-project\clang\test\Index\usrs.m" "-isystem" "F:\source\llvm-project\clang\test\Index/Inputs"
  # command stderr:
  F:\source\llvm-project\clang\test\Index\usrs.m:25:12: warning: class 'Foo' defined without specifying a base class [-Wobjc-root-class]
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:25:15: note: add a super class to fix this problem
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:51:12: warning: class 'CWithExt' defined without specifying a base class [-Wobjc-root-class]
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:51:20: note: add a super class to fix this problem
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:101:9: warning: 'MACRO3' macro redefined [-Wmacro-redefined]
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:100:9: note: previous definition is here
  Number FIX-ITs = 0
  
  $ "f:\source\llvm-project\llvm\out\build\x64-debug\bin\filecheck.exe" "F:\source\llvm-project\clang\test\Index\usrs.m"
  $ ":" "RUN: at line 173"
  $ "f:\source\llvm-project\llvm\out\build\x64-debug\bin\c-index-test.exe" "-test-load-source" "all" "F:\source\llvm-project\clang\test\Index\usrs.m" "-isystem" "F:\source\llvm-project\clang\test\Index/Inputs"
  # command stderr:
  F:\source\llvm-project\clang\test\Index\usrs.m:44:13: error: synthesized property 'd1' must either be named the same as a compatible instance variable or must explicitly name an instance variable
  F:\source\llvm-project\clang\test\Index\usrs.m:25:12: warning: class 'Foo' defined without specifying a base class [-Wobjc-root-class]
  F:\source\llvm-project\clang\test\Index\usrs.m:25:15: note: add a super class to fix this problem
  F:\source\llvm-project\clang\test\Index\usrs.m:51:12: warning: class 'CWithExt' defined without specifying a base class [-Wobjc-root-class]
  F:\source\llvm-project\clang\test\Index\usrs.m:51:20: note: add a super class to fix this problem
  F:\source\llvm-project\clang\test\Index\usrs.m:86:6: error: instance variables may not be placed in class extension
  F:\source\llvm-project\clang\test\Index\usrs.m:101:9: warning: 'MACRO3' macro redefined [-Wmacro-redefined]
  F:\source\llvm-project\clang\test\Index\usrs.m:100:9: note: previous definition is here
  F:\source\llvm-project\clang\test\Index\usrs.m:44:13: error: synthesized property 'd1' must either be named the same as a compatible instance variable or must explicitly name an instance variable
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:25:12: warning: class 'Foo' defined without specifying a base class [-Wobjc-root-class]
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:25:15: note: add a super class to fix this problem
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:51:12: warning: class 'CWithExt' defined without specifying a base class [-Wobjc-root-class]
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:51:20: note: add a super class to fix this problem
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:86:6: error: instance variables may not be placed in class extension
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:101:9: warning: 'MACRO3' macro redefined [-Wmacro-redefined]
  Number FIX-ITs = 0
  F:\source\llvm-project\clang\test\Index\usrs.m:100:9: note: previous definition is here
  Number FIX-ITs = 0
  
  $ "f:\source\llvm-project\llvm\out\build\x64-debug\bin\filecheck.exe" "-check-prefix=CHECK-source" "F:\source\llvm-project\clang\test\Index\usrs.m"
  # command stderr:
  F:\source\llvm-project\clang\test\Index\usrs.m:188:18: error: CHECK-source: expected string not found in input
  // CHECK-source: usrs.m:5:1: EnumDecl=:5:1 (Definition) Extent=[5:1 - 8:2]
                   ^
  <stdin>:386:63: note: scanning from here
  // CHECK: usrs.m:3:56: DeclRefExpr=y:3:40 Extent=[3:56 - 3:57]
                                                                ^
  <stdin>:387:89: note: possible intended match here
  // CHECK: usrs.m:5:1: EnumDecl=enum (unnamed at F:\source\llvm-project\clang\test\Index\usrs.m:5:1):5:1 (Definition) Extent=[5:1 - 8:2]
                                                                                          ^
  
  Input file: <stdin>
  Check file: F:\source\llvm-project\clang\test\Index\usrs.m
  
  -dump-input=help explains the following input dump.
  
  Input was:
  <<<<<<
               .
               .
               .
             381: // CHECK: usrs.m:3:45: ReturnStmt= Extent=[3:45 - 3:57]
             382: // CHECK: usrs.m:3:52: BinaryOperator= Extent=[3:52 - 3:57]
             383: // CHECK: usrs.m:3:52: UnexposedExpr=x:3:33 Extent=[3:52 - 3:53]
             384: // CHECK: usrs.m:3:52: DeclRefExpr=x:3:33 Extent=[3:52 - 3:53]
             385: // CHECK: usrs.m:3:56: UnexposedExpr=y:3:40 Extent=[3:56 - 3:57]
             386: // CHECK: usrs.m:3:56: DeclRefExpr=y:3:40 Extent=[3:56 - 3:57]
  check:188'0                                                                   X error: no match found
             387: // CHECK: usrs.m:5:1: EnumDecl=enum (unnamed at F:\source\llvm-project\clang\test\Index\usrs.m:5:1):5:1 (Definition) Extent=[5:1 - 8:2]
  check:188'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  check:188'1                                                                                             ?                                                possible intended match
             388: // CHECK: usrs.m:6:3: EnumConstantDecl=ABA:6:3 (Definition) Extent=[6:3 - 6:6]
  check:188'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             389: // CHECK: usrs.m:7:3: EnumConstantDecl=CADABA:7:3 (Definition) Extent=[7:3 - 7:9]
  check:188'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             390: // CHECK: usrs.m:10:1: EnumDecl=enum (unnamed at F:\source\llvm-project\clang\test\Index\usrs.m:10:1):10:1 (Definition) Extent=[10:1 - 13:2]
  check:188'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             391: // CHECK: usrs.m:11:3: EnumConstantDecl=FOO:11:3 (Definition) Extent=[11:3 - 11:6]
  check:188'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             392: // CHECK: usrs.m:12:3: EnumConstantDecl=BAR:12:3 (Definition) Extent=[12:3 - 12:6]
  check:188'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
               .
               .
               .
  >>>>>>
  
  error: command failed with exit status: 1
  
  --
  
  ********************
  Testing:
  FAIL: Clang :: ExtractAPI/enum.c (3 of 15539)
  ******************** TEST 'Clang :: ExtractAPI/enum.c' FAILED ********************
  Script:
  --
  : 'RUN: at line 1';   rm -rf F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp
  : 'RUN: at line 2';   split-file F:\source\llvm-project\clang\test\ExtractAPI\enum.c F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp
  : 'RUN: at line 3';   sed -e "s at INPUT_DIR@F:/source/llvm-project/llvm/out/build/x64-Debug/tools/clang/test/ExtractAPI/Output/enum.c.tmp at g"  F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/reference.output.json.in >> F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/reference.output.json
  : 'RUN: at line 5';   f:\source\llvm-project\llvm\out\build\x64-debug\bin\clang.exe -cc1 -internal-isystem f:\source\llvm-project\llvm\out\build\x64-debug\lib\clang\16.0.0\include -nostdsysteminc -extract-api -triple arm64-apple-macosx    -x c-header F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/input.h -o F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/output.json -verify
  : 'RUN: at line 9';   sed -e "s@\"generator\": \".*\"@\"generator\": \"?\"@g"  F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/output.json >> F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/output-normalized.json
  : 'RUN: at line 11';   diff F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/reference.output.json F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/output-normalized.json
  --
  Exit Code: 1
  
  Command Output (stdout):
  --
  $ ":" "RUN: at line 1"
  $ "rm" "-rf" "F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp"
  $ ":" "RUN: at line 2"
  $ "split-file" "F:\source\llvm-project\clang\test\ExtractAPI\enum.c" "F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp"
  $ ":" "RUN: at line 3"
  $ "sed" "-e" "s at INPUT_DIR@F:/source/llvm-project/llvm/out/build/x64-Debug/tools/clang/test/ExtractAPI/Output/enum.c.tmp at g" "F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/reference.output.json.in"
  $ ":" "RUN: at line 5"
  $ "f:\source\llvm-project\llvm\out\build\x64-debug\bin\clang.exe" "-cc1" "-internal-isystem" "f:\source\llvm-project\llvm\out\build\x64-debug\lib\clang\16.0.0\include" "-nostdsysteminc" "-extract-api" "-triple" "arm64-apple-macosx" "-x" "c-header" "F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/input.h" "-o" "F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/output.json" "-verify"
  $ ":" "RUN: at line 9"
  $ "sed" "-e" "s@"generator": ".*"@"generator": "?"@g" "F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/output.json"
  $ ":" "RUN: at line 11"
  $ "diff" "F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/reference.output.json" "F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/output-normalized.json"
  # command output:
  *** F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/reference.output.json
  --- F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\ExtractAPI\Output\enum.c.tmp/output-normalized.json
  ***************
  *** 655,667 ****
            "navigator": [
              {
                "kind": "identifier",
  !             "spelling": "(anonymous)"
  !           }
  !         ],
  !         "title": "(anonymous)"
  !       },
  !       "pathComponents": [
  !         "(anonymous)"
          ]
        },
        {
  --- 655,667 ----
            "navigator": [
              {
                "kind": "identifier",
  !             "spelling": "enum (unnamed at F:\\source\\llvm-project\\llvm\\out\\build\\x64-Debug\\tools\\clang\\test\\ExtractAPI\\Output\\enum.c.tmp/input.h:17:1)"
  !           }
  !         ],
  !         "title": "enum (unnamed at F:\\source\\llvm-project\\llvm\\out\\build\\x64-Debug\\tools\\clang\\test\\ExtractAPI\\Output\\enum.c.tmp/input.h:17:1)"
  !       },
  !       "pathComponents": [
  !         "enum (unnamed at F:\\source\\llvm-project\\llvm\\out\\build\\x64-Debug\\tools\\clang\\test\\ExtractAPI\\Output\\enum.c.tmp/input.h:17:1)"
          ]
        },
        {
  ***************
  *** 703,709 ****
            "title": "Constant"
          },
          "pathComponents": [
  !         "(anonymous)",
            "Constant"
          ]
        },
  --- 703,709 ----
            "title": "Constant"
          },
          "pathComponents": [
  !         "enum (unnamed at F:\\source\\llvm-project\\llvm\\out\\build\\x64-Debug\\tools\\clang\\test\\ExtractAPI\\Output\\enum.c.tmp/input.h:17:1)",
            "Constant"
          ]
        },
  ***************
  *** 743,755 ****
            "navigator": [
              {
                "kind": "identifier",
  !             "spelling": "(anonymous)"
  !           }
  !         ],
  !         "title": "(anonymous)"
  !       },
  !       "pathComponents": [
  !         "(anonymous)"
          ]
        },
        {
  --- 743,755 ----
            "navigator": [
              {
                "kind": "identifier",
  !             "spelling": "enum (unnamed at F:\\source\\llvm-project\\llvm\\out\\build\\x64-Debug\\tools\\clang\\test\\ExtractAPI\\Output\\enum.c.tmp/input.h:21:1)"
  !           }
  !         ],
  !         "title": "enum (unnamed at F:\\source\\llvm-project\\llvm\\out\\build\\x64-Debug\\tools\\clang\\test\\ExtractAPI\\Output\\enum.c.tmp/input.h:21:1)"
  !       },
  !       "pathComponents": [
  !         "enum (unnamed at F:\\source\\llvm-project\\llvm\\out\\build\\x64-Debug\\tools\\clang\\test\\ExtractAPI\\Output\\enum.c.tmp/input.h:21:1)"
          ]
        },
        {
  ***************
  *** 791,797 ****
            "title": "OtherConstant"
          },
          "pathComponents": [
  !         "(anonymous)",
            "OtherConstant"
          ]
        }
  --- 791,797 ----
            "title": "OtherConstant"
          },
          "pathComponents": [
  !         "enum (unnamed at F:\\source\\llvm-project\\llvm\\out\\build\\x64-Debug\\tools\\clang\\test\\ExtractAPI\\Output\\enum.c.tmp/input.h:21:1)",
            "OtherConstant"
          ]
        }
  
  error: command failed with exit status: 1
  
  --
  
  ********************
  Testing:
  FAIL: Clang :: Index/annotate-comments-typedef.m (4 of 15539)
  ******************** TEST 'Clang :: Index/annotate-comments-typedef.m' FAILED ********************
  Script:
  --
  : 'RUN: at line 1';   rm -rf F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\Index\Output\annotate-comments-typedef.m.tmp
  : 'RUN: at line 2';   mkdir F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\Index\Output\annotate-comments-typedef.m.tmp
  : 'RUN: at line 3';   f:\source\llvm-project\llvm\out\build\x64-debug\bin\c-index-test.exe -test-load-source all -comments-xml-schema=F:\source\llvm-project\clang\test\Index/../../bindings/xml/comment-xml-schema.rng F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m > F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\Index\Output\annotate-comments-typedef.m.tmp/out
  : 'RUN: at line 4';   f:\source\llvm-project\llvm\out\build\x64-debug\bin\filecheck.exe F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m < F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\Index\Output\annotate-comments-typedef.m.tmp/out
  : 'RUN: at line 8';   f:\source\llvm-project\llvm\out\build\x64-debug\bin\filecheck.exe F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m -check-prefix=WRONG < F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\Index\Output\annotate-comments-typedef.m.tmp/out
  --
  Exit Code: 1
  
  Command Output (stdout):
  --
  $ ":" "RUN: at line 1"
  $ "rm" "-rf" "F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\Index\Output\annotate-comments-typedef.m.tmp"
  $ ":" "RUN: at line 2"
  $ "mkdir" "F:\source\llvm-project\llvm\out\build\x64-Debug\tools\clang\test\Index\Output\annotate-comments-typedef.m.tmp"
  $ ":" "RUN: at line 3"
  $ "f:\source\llvm-project\llvm\out\build\x64-debug\bin\c-index-test.exe" "-test-load-source" "all" "-comments-xml-schema=F:\source\llvm-project\clang\test\Index/../../bindings/xml/comment-xml-schema.rng" "F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m"
  $ ":" "RUN: at line 4"
  $ "f:\source\llvm-project\llvm\out\build\x64-debug\bin\filecheck.exe" "F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m"
  # command stderr:
  F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m:39:11: error: CHECK: expected string not found in input
  // CHECK: StructDecl=:[[@LINE-4]]:9 (Definition) {{.*}} BriefComment=[Comment about Foo] FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Class file="{{[^"]+}}annotate-comments-typedef.m" line="[[@LINE-4]]" column="9"><Name><anonymous></Name><USR>c:@SA at Foo</USR><Declaration>struct {}</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Class>]
            ^
  <stdin>:452:521: note: scanning from here
  // CHECK: annotate-comments-typedef.m:37:11: TypedefDecl=Foo:37:11 (Definition) RawComment=[/** Comment about Foo */] RawCommentRange=[34:1 - 34:25] BriefComment=[Comment about Foo] FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Typedef file="F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m" line="37" column="11"><Name>Foo</Name><USR>c:@T at Foo</USR><Declaration>typedef struct Foo Foo</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Typedef>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^
  <stdin>:452:521: note: with "@LINE-4" equal to "35"
  // CHECK: annotate-comments-typedef.m:37:11: TypedefDecl=Foo:37:11 (Definition) RawComment=[/** Comment about Foo */] RawCommentRange=[34:1 - 34:25] BriefComment=[Comment about Foo] FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Typedef file="F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m" line="37" column="11"><Name>Foo</Name><USR>c:@T at Foo</USR><Declaration>typedef struct Foo Foo</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Typedef>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^
  <stdin>:452:521: note: with "@LINE-4" equal to "35"
  // CHECK: annotate-comments-typedef.m:37:11: TypedefDecl=Foo:37:11 (Definition) RawComment=[/** Comment about Foo */] RawCommentRange=[34:1 - 34:25] BriefComment=[Comment about Foo] FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Typedef file="F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m" line="37" column="11"><Name>Foo</Name><USR>c:@T at Foo</USR><Declaration>typedef struct Foo Foo</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Typedef>]
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ^
  
  Input file: <stdin>
  Check file: F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m
  
  -dump-input=help explains the following input dump.
  
  Input was:
  <<<<<<
              .
              .
              .
            447: // CHECK: CommentAST=[
            448: // CHECK: (CXComment_FullComment
            449: // CHECK: (CXComment_Paragraph
            450: // CHECK: (CXComment_Text Text=[ Comment about Foo ])))] Extent=[35:9 - 37:10]
            451: // CHECK: annotate-comments-typedef.m:36:14: FieldDecl=iii:36:14 (Definition) Extent=[36:10 - 36:17] [access=public]
            452: // CHECK: annotate-comments-typedef.m:37:11: TypedefDecl=Foo:37:11 (Definition) RawComment=[/** Comment about Foo */] RawCommentRange=[34:1 - 34:25] BriefComment=[Comment about Foo] FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Typedef file="F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m" line="37" column="11"><Name>Foo</Name><USR>c:@T at Foo</USR><Declaration>typedef struct Foo Foo</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Typedef>]
  check:39'0                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             X error: no match found
  check:39'1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               with "@LINE-4" equal to "35"
  check:39'2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               with "@LINE-4" equal to "35"
            453: // CHECK: CommentAST=[
  check:39'0     ~~~~~~~~~~~~~~~~~~~~~~~
            454: // CHECK: (CXComment_FullComment
  check:39'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            455: // CHECK: (CXComment_Paragraph
  check:39'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            456: // CHECK: (CXComment_Text Text=[ Comment about Foo ])))] Extent=[35:1 - 37:14]
  check:39'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            457: // CHECK: annotate-comments-typedef.m:35:9: StructDecl=Foo:35:9 (Definition) RawComment=[/** Comment about Foo */] RawCommentRange=[34:1 - 34:25] BriefComment=[Comment about Foo] FullCommentAsHTML=[<p class="para-brief"> Comment about Foo </p>] FullCommentAsXML=[<Class file="F:\source\llvm-project\clang\test\Index\annotate-comments-typedef.m" line="35" column="9"><Name><anonymous></Name><USR>c:@SA at Foo</USR><Declaration>struct {}</Declaration><Abstract><Para> Comment about Foo </Para></Abstract></Class>]
  check:39'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              .
              .
              .
  >>>>>>
  
  error: command failed with exit status: 1
  
  --
  
  ********************
  Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
  ********************
  Failed Tests (3):
    Clang :: ExtractAPI/enum.c
    Clang :: Index/annotate-comments-typedef.m
    Clang :: Index/usrs.m
  
  
  Testing Time: 379.02s
    Unsupported      :  1760
    Passed           : 13745
    Expectedly Failed:    31
    Failed           :     3
  
  1 warning(s) in tests

and also the clangd unit tests failed:

  [----------] 1 test from FindExplicitReferencesTest
  [ RUN      ] FindExplicitReferencesTest.All
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.06 seconds
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.07 seconds
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.07 seconds
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.06 seconds
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.09 seconds
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.06 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187212 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.06 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.07 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.07 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  F:\source\llvm-project\clang-tools-extra\clangd\unittests\FindTargetTests.cpp(1924): error: Expected equality of these values:
    ExpectedRefs
      Which is: "0: targets = {}\n1: targets = {x}, decl\n2: targets = {fptr}, decl\n3: targets = {a}, decl\n"
    Actual.DumpedReferences
      Which is: "0: targets = {(unnamed)}\n1: targets = {x}, decl\n2: targets = {fptr}, decl\n3: targets = {a}, decl\n"
  With diff:
  @@ -1,3 +1,3 @@
  -0: targets = {}
  +0: targets = {(unnamed)}
   1: targets = {x}, decl
   2: targets = {fptr}, decl
  
  
               void foo() {
                $0^class {} $1^x;
                int (*$2^fptr)(int $3^a, int) = nullptr;
               }
  
  Built preamble of size 187028 for file C:\clangd-test\TestTU.cpp version null in 0.09 seconds
  Built preamble of size 187028 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187028 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.07 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.06 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.06 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.06 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.06 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.06 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.07 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.07 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.07 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.08 seconds
  Built preamble of size 187024 for file C:\clangd-test\TestTU.cpp version null in 0.07 seconds
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.06 seconds
  Built preamble of size 187020 for file C:\clangd-test\TestTU.cpp version null in 0.07 seconds
  [  FAILED  ] FindExplicitReferencesTest.All (19046 ms)
  [----------] 1 test from FindExplicitReferencesTest (19048 ms total)

I'm testing on Windows, FWIW.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134813



More information about the cfe-commits mailing list