clang++ incorrectly rejects program containing nested classes and operator= overload #59684
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
rejects-valid
I'm seeing a strange compile error when trying to compile the bsnes-plus emulator. Here's the minimal excerpt of the source code that reproduces the problem:
The error is:
It appears the compiler is not recognizing the
operator=
overload.Every component of the
CPUcore
declaration reproduced here is necessary to trigger the error -- theflag_t
struct must be declared inside CPUcore, it must be used a member variable ofregs_t
alongside a reference variable, and theregs_t
struct must be used as a member variable ofCPUcore
Changing any one of those conditions will cause the code to compile successfully.I'm running macOS 13 on an M1 Pro. The bug is reproducible in LLVM 11.0 and newer when built from source or installed via Homebrew; bisecting finds the bug was introduced in d144601. Curiously, the bug is not reproducible on the version of Clang that ships with the Apple developer tools.
The text was updated successfully, but these errors were encountered: