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

Hubert Tong via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 17 09:09:17 PDT 2024


hubert-reinterpretcast wrote:

@cor3ntin @AaronBallman, the new diagnostic triggers for valid code (https://gcc.godbolt.org/z/fMvEaGabG):
```cpp
#include <type_traits>
 
struct S {
    int x;
    static_assert(std::is_same<decltype((S::x)), int &>::value, "");
    static_assert(std::is_same<decltype(&(S::x)), int *>::value, "");
};
```

Either the first `static_assert` is invalid or both `static_assert`s are valid.

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


More information about the cfe-commits mailing list