[clang] [Clang] Do not treat Foo -> const Foo conversion sequences as perfect (PR #148613)

Matthias Braun via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 16 15:47:15 PDT 2025


MatzeB wrote:

FYI: This change breaks common thrift-generated code. Reduced example here shows the problem and produces "expression is not assignable" (but is accepted by all released gcc and clang versions as far as I can tell). No idea if the code is valid/invalid:
```
#include <exception>
struct TmsException : public std::exception {
  int _what;

  const char* what() const noexcept override { return ""; }

  template<typename..., typename T=int>
  T& what() & { return _what; }
};
int main() {
  TmsException E;
  E.what() = 42;
}
```

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


More information about the cfe-commits mailing list