[clang] [clang-tools-extra] [clangd] Respect ArgumentLists for struct templates (PR #212094)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 26 00:11:28 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results

* 55808 tests passed
* 1425 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.Index/index-refs.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 77
c:\_work\llvm-project\llvm-project\build\bin\c-index-test.exe -index-file C:\_work\llvm-project\llvm-project\clang\test\Index\index-refs.cpp | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\Index\index-refs.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\c-index-test.exe' -index-file 'C:\_work\llvm-project\llvm-project\clang\test\Index\index-refs.cpp'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\Index\index-refs.cpp'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\Index\index-refs.cpp:108:11: error: CHECK: expected string not found in input
# | // CHECK: [indexDeclaration]: kind: c++-class-template | name: TS | {{.*}} | loc: 47:8
# |           ^
# | <stdin>:43:140: note: scanning from here
# | [indexEntityReference]: kind: typedef | name: Foo | USR: c:index-refs.cpp at N@NS at T@Foo | lang: C | cursor: TypeRef=NS::Foo:39:15 | loc: 44:11 | <parent>:: <<NULL>> | container: [TU] | refkind: direct | role: ref
# |                                                                                                                                            ^
# | <stdin>:44:1: note: possible intended match here
# | [indexDeclaration]: kind: struct-template | name: TS | USR: c:@ST>2#T#T at TS | lang: C++ | cursor: StructDecl=TS:47:8 (Definition) | loc: 47:8 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit: 0
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\clang\test\Index\index-refs.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |             38: [indexDeclaration]: kind: typedef | name: Foo | USR: c:index-refs.cpp at N@NS at T@Foo | lang: C | cursor: TypedefDecl=Foo:39:15 (Definition) | loc: 39:15 | semantic-container: [NS:37:11] | lexical-container: [NS:37:11] | isRedecl: 0 | isDef: 1 | isContainer: 0 | isImplicit: 0 
# |             39: [indexEntityReference]: kind: namespace | name: NS | USR: c:@N at NS | lang: C++ | cursor: NamespaceRef=NS:2:11 | loc: 42:17 | <parent>:: <<NULL>> | container: [TU] | refkind: direct | role: ref 
# |             40: [indexEntityReference]: kind: namespace | name: NS | USR: c:@N at NS | lang: C++ | cursor: NamespaceRef=NS:37:11 | loc: 43:17 | <parent>:: <<NULL>> | container: [TU] | refkind: direct | role: ref 
# |             41: [indexEntityReference]: kind: namespace | name: Inn | USR: c:@N at NS@N at Inn | lang: C++ | cursor: NamespaceRef=Inn:38:13 | loc: 43:21 | <parent>:: <<NULL>> | container: [TU] | refkind: direct | role: ref 
# |             42: [indexEntityReference]: kind: namespace | name: NS | USR: c:@N at NS | lang: C++ | cursor: NamespaceRef=NS:37:11 | loc: 44:7 | <parent>:: <<NULL>> | container: [TU] | refkind: direct | role: ref 
# |             43: [indexEntityReference]: kind: typedef | name: Foo | USR: c:index-refs.cpp at N@NS at T@Foo | lang: C | cursor: TypeRef=NS::Foo:39:15 | loc: 44:11 | <parent>:: <<NULL>> | container: [TU] | refkind: direct | role: ref 
# | check:108'0                                                                                                                                               {                                                                         search range start (exclusive)
# | check:108'1                                                                                                                                                                                                                         error: no match found in search range
# |             44: [indexDeclaration]: kind: struct-template | name: TS | USR: c:@ST>2#T#T at TS | lang: C++ | cursor: StructDecl=TS:47:8 (Definition) | loc: 47:8 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit: 0 
# | check:108'2     ?                                                                                                                                                                                                                                                             possible intended match
# |             45: [indexDeclaration]: kind: struct-template-partial-spec | name: TS | USR: c:@SP>1#T at TS>#t0.0#I | lang: C++ | cursor: ClassTemplatePartialSpecialization=TS:50:8 (Definition) [Specialization of TS:47:8] [Template arg 0: kind: 1, type: type-parameter-0-0] [Template arg 1: kind: 1, type: int] | loc: 50:8 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit: 0 
# |             46: [indexDeclaration]: kind: typedef | name: MyInt | USR: c:index-refs.cpp at SP>1#T at TS>#t0.0#I at T@MyInt | lang: C | cursor: TypedefDecl=MyInt:51:15 (Definition) | loc: 51:15 | semantic-container: [TS:50:8] | lexical-container: [TS:50:8] | isRedecl: 0 | isDef: 1 | isContainer: 0 | isImplicit: 0 
# |             47: [indexDeclaration]: kind: function | name: foo3 | USR: c:@F at foo3# | lang: C | cursor: FunctionDecl=foo3:54:6 (Definition) | loc: 54:6 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit: 0 
# |             48: [indexEntityReference]: kind: struct-template-partial-spec | name: TS | USR: c:@SP>1#T at TS>#t0.0#I | lang: C++ | cursor: TypeRef=struct TS<int, int>:50:8 | loc: 55:3 | <parent>:: kind: function | name: foo3 | USR: c:@F at foo3# | lang: C | container: [foo3:54:6] | refkind: direct | role: ref 
# |             49: [indexDeclaration]: kind: variable | name: array_size | USR: c:index-refs.cpp at array_size | lang: C | cursor: VarDecl=array_size:58:11 (Definition) | loc: 58:11 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 0 | isImplicit: 0 
# |              .
# |              .
# |              .
# |             64: [indexEntityReference]: kind: function | name: foo3 | USR: c:@F at foo3# | lang: C | cursor: DeclRefExpr=foo3:54:6 | loc: 71:10 | <parent>:: kind: function | name: foo5 | USR: c:@F at foo5# | lang: C | container: [foo5:68:6] | refkind: direct | role: ref addr 
# |             65: [indexEntityReference]: kind: function | name: foo4 | USR: c:@F at foo4#I# | lang: C | cursor: DeclRefExpr=foo4:62:6 | loc: 72:3 | <parent>:: kind: function | name: foo5 | USR: c:@F at foo5# | lang: C | container: [foo5:68:6] | refkind: direct | role: ref call 
# |             66: [indexEntityReference]: kind: field | name: y | USR: c:@S at S2@FI at y | lang: C | cursor: MemberRefExpr=y:65:9 SingleRefName=[72:10 - 72:11] RefName=[72:10 - 72:11] | loc: 72:10 | <parent>:: kind: function | name: foo5 | USR: c:@F at foo5# | lang: C | container: [foo5:68:6] | refkind: direct | role: ref read 
# |             67: [indexDeclaration]: kind: variable | name: ginitlist | USR: c:@ginitlist | lang: C | cursor: VarDecl=ginitlist:75:5 (Definition) | loc: 75:5 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 0 | isImplicit: 0 
# |             68: [indexEntityReference]: kind: enumerator | name: EnumVal | USR: c:@Ea at EnumVal@EnumVal | lang: C | cursor: DeclRefExpr=EnumVal:8:3 | loc: 75:20 | <parent>:: kind: variable | name: ginitlist | USR: c:@ginitlist | lang: C | container: [TU] | refkind: direct | role: ref 
# |             69: [diagnostic]: C:\_work\llvm-project\llvm-project\clang\test\Index\index-refs.cpp:69:32: warning: ISO C++ requires field designators to be specified in declaration order; field 'y' will be initialized after field 'x' [-Wreorder-init-list] 
# | check:108'3                                                                                                                                                                                                                                                   } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang.Index/index-template-specialization.cpp</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 20
env CINDEXTEST_INDEXIMPLICITTEMPLATEINSTANTIATIONS=1 c:\_work\llvm-project\llvm-project\build\bin\c-index-test.exe -index-file C:\_work\llvm-project\llvm-project\clang\test\Index\index-template-specialization.cpp | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\Index\index-template-specialization.cpp
# executed command: env CINDEXTEST_INDEXIMPLICITTEMPLATEINSTANTIATIONS=1 'c:\_work\llvm-project\llvm-project\build\bin\c-index-test.exe' -index-file 'C:\_work\llvm-project\llvm-project\clang\test\Index\index-template-specialization.cpp'
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\Index\index-template-specialization.cpp'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\Index\index-template-specialization.cpp:27:11: error: CHECK: expected string not found in input
# | // CHECK: [indexDeclaration]: kind: c++-class-template | name: D
# |           ^
# | <stdin>:7:91: note: scanning from here
# | [indexEntityReference]: kind: c++-instance-method | name: f | USR: c:@ST>1#T at Foo@F at f#t0.0# | lang: C++ | cursor: MemberRefExpr=f:4:8 SingleRefName=[9:7 - 9:8] RefName=[9:7 - 9:8] | loc: 9:7 | <parent>:: kind: function | name: g | USR: c:@F at g# | lang: C | container: [g:7:6] | refkind: direct | role: ref call
# |                                                                                           ^
# | <stdin>:9:1: note: possible intended match here
# | [indexDeclaration]: kind: struct-template | name: D | USR: c:@ST>1#T at D | lang: C++ | cursor: StructDecl=D:16:8 (Definition) | loc: 16:8 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit: 0
# | ^
# | 
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\clang\test\Index\index-template-specialization.cpp
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |             1: [startedTranslationUnit] 
# |             2: [enteredMainFile]: C:\_work\llvm-project\llvm-project\clang\test\Index\index-template-specialization.cpp 
# |             3: [indexDeclaration]: kind: c++-class-template | name: Foo | USR: c:@ST>1#T at Foo | lang: C++ | cursor: ClassDecl=Foo:2:7 (Definition) | loc: 2:7 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit: 0 
# |             4: [indexDeclaration]: kind: c++-instance-method | name: f | USR: c:@ST>1#T at Foo@F at f#t0.0# | lang: C++ | cursor: CXXMethod=f:4:8 | loc: 4:8 | semantic-container: [Foo:2:7] | lexical-container: [Foo:2:7] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit: 0 
# |             5: [indexDeclaration]: kind: function | name: g | USR: c:@F at g# | lang: C | cursor: FunctionDecl=g:7:6 (Definition) | loc: 7:6 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit: 0 
# |             6: [indexEntityReference]: kind: c++-class-template | name: Foo | USR: c:@ST>1#T at Foo | lang: C++ | cursor: TypeRef=class Foo<int>:2:7 | loc: 8:3 | <parent>:: kind: function | name: g | USR: c:@F at g# | lang: C | container: [g:7:6] | refkind: direct | role: ref 
# |             7: [indexEntityReference]: kind: c++-instance-method | name: f | USR: c:@ST>1#T at Foo@F at f#t0.0# | lang: C++ | cursor: MemberRefExpr=f:4:8 SingleRefName=[9:7 - 9:8] RefName=[9:7 - 9:8] | loc: 9:7 | <parent>:: kind: function | name: g | USR: c:@F at g# | lang: C | container: [g:7:6] | refkind: direct | role: ref call 
# | check:27'0                                                                                              {                                                                                                                                                                                                                             search range start (exclusive)
# | check:27'1                                                                                                                                                                                                                                                                                                                            error: no match found in search range
# |             8: [indexDeclaration]: kind: struct-template | name: B | USR: c:@ST>1#T at B | lang: C++ | cursor: StructDecl=B:13:8 (Definition) | loc: 13:8 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit: 0 
# |             9: [indexDeclaration]: kind: struct-template | name: D | USR: c:@ST>1#T at D | lang: C++ | cursor: StructDecl=D:16:8 (Definition) | loc: 16:8 | semantic-container: [TU] | lexical-container: [TU] | isRedecl: 0 | isDef: 1 | isContainer: 1 | isImplicit: 0 
# | check:27'2     ?                                                                                                                                                                                                                                                        possible intended match
# |            10:  <base>: kind: struct-template | name: B | USR: c:@ST>1#T at B | lang: C++ | cursor: C++ base class specifier=B<T>:13:8 [access=public isVirtual=false] | loc: 16:12 
# |            11: [indexEntityReference]: kind: struct-template | name: B | USR: c:@ST>1#T at B | lang: C++ | cursor: TemplateRef=B:13:8 | loc: 16:12 | <parent>:: kind: struct-template | name: D | USR: c:@ST>1#T at D | lang: C++ | container: [D:16:8] | refkind: direct | role: ref 
# | check:27'3                                                                                                                                                                                                                                                                      } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the cfe-commits mailing list