Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failed: (Result.isInvalid() && "C++ binary operator overloading is missing candidates!") #62503

Open
int3 opened this issue May 3, 2023 · 5 comments
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party crash-on-invalid

Comments

@int3
Copy link
Contributor

int3 commented May 3, 2023

Line 19 of the following file triggers a parsing assertion error:

test.mm

#include <Foundation/Foundation.h>

enum class Bar : int {
  QUX,
};

@interface Foo : NSObject
+(int) foo;
+(void) run;
@end

@implementation Foo
+(int) foo {
  return 0;
}

+(void) run {
  Bar bar;
  bar = {[self foo]};
}
@end

Compile with clang++ -std=c++17 -c test.mm. Workaround is to explicitly specify Bar{...} on that line.

@int3 int3 added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label May 3, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented May 3, 2023

@llvm/issue-subscribers-clang-frontend

@shafik
Copy link
Collaborator

shafik commented May 3, 2023

CC @rjmccall

@tvc
Copy link

tvc commented Jun 20, 2023

I'm able to reproduce with this short snippet.

enum class E {};

int main() {
        E e;
        e = {0};
}

Compiled with clang -std=c++17 -c test.cpp.

@shafik
Copy link
Collaborator

shafik commented Jun 20, 2023

Nice, that is a much simpler case.

Looks like a duplicate of: #27443 although could be different underlying causes.

@shafik shafik added confirmed Verified by a second party crash-on-invalid labels Jun 20, 2023
@shafik
Copy link
Collaborator

shafik commented Jun 20, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" confirmed Verified by a second party crash-on-invalid
Projects
None yet
Development

No branches or pull requests

4 participants