Unverified Commit 8480c93e authored by YanzuoLiu's avatar YanzuoLiu Committed by GitHub
Browse files

[clang] pointer to member with qualified-id enclosed in parentheses in...


[clang] pointer to member with qualified-id enclosed in parentheses in unevaluated context should be invalid (#89713)

clang don't check whether the operand of the & operator is enclosed in
parantheses when pointer to member is formed in unevaluated context, for
example:

```cpp
struct foo { int val; };

int main() { decltype(&(foo::val)) ptr; }
```

`decltype(&(foo::val))` should be invalid, but clang accepts it. This PR
fixes this issue.

Fixes #40906.

---------

Co-authored-by: default avatarcor3ntin <corentinjabot@gmail.com>
parent e4b04b39
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment