=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= <tigbrc...@protonmail.com>,
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= <tigbrc...@protonmail.com>,
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= <tigbrc...@protonmail.com>,
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= <tigbrc...@protonmail.com>,
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= <tigbrc...@protonmail.com>,
=?utf-8?b?R8OhYm9yIFTDs3RodsOhcmk=?= <tigbrc...@protonmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/89...@github.com>


https://github.com/whisperity requested changes to this pull request.

I found a very convoluted and somewhat silly edge case where I was able to 
defeat the matchers to make them produce a match in a position where it is 
clearly not intended. So the matchers will need to be given some thought, my 
idea is to have them constricted in a way to report only into non-implicit 
code, but perhaps this needs some more elaboration.

Lambdas implicitly compile down to an unnamed `CXXRecordDecl`, and if you have 
captures in a lambda, they become (unnamed) fields of this class.

https://godbolt.org/z/rvfY5K18T

```cpp
enum E { A };
union U {
    int A;
};

int main() {
    enum E e;
    union U u;
    auto L = [e, u] () {};
}
```

```
Match #1:

<source>:9:14: note: "root" binds here
    9 |     auto L = [e, u] () {};
      |              ^
<source>:9:15: note: "tags" binds here
    9 |     auto L = [e, u] () {};
      |               ^
<source>:9:18: note: "union" binds here
    9 |     auto L = [e, u] () {};
      |                  ^
```

https://github.com/llvm/llvm-project/pull/89925
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to