[PATCH] D123319: Change how we handle auto return types for lambda operator() to be consistent with gcc

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 18 08:55:41 PDT 2022


shafik added inline comments.


================
Comment at: clang/test/CodeGenCXX/no_auto_return_lambda.cpp:8
+
+// CHECK: !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+// CHECK-NOT: !DIBasicType(tag: DW_TAG_unspecified_type, name: "auto")
----------------
aprantl wrote:
> This test is very fragile. Instead of checking that no unspecified type *follows* the first declaration of `int` and hoping that no other `int` is emitted in this CU, it would be better to explictly check for the return type of the `DISubprogram` for `g` using FileCheck variable substitutions.
I thought about that but there are a couple of steps to get there e.g.:

```
!10 = distinct !DISubprogram(name: "g", linkageName: "_Z1gv", scope: !8, file: !8, line: 1, type: !11, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !14)
!11 = !DISubroutineType(types: !12)
!12 = !{!13}
!13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
```

I have to go from 11 to 12 to 13, is there a better way?


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

https://reviews.llvm.org/D123319



More information about the cfe-commits mailing list