-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Closed
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"rejects-valid
Description
https://godbolt.org/z/E5xqebhfK
struct A {
template <auto N>
void operator+=(this auto &&obj, const char (&c)[N]) {
}
void operator+=(this auto &&obj, auto &&c) {
}
};
int main() {
A a;
a += "123";
}
<source>:11:7: error: use of overloaded operator '+=' is ambiguous (with operand types 'A' and 'const char[4]')
11 | a += "123";
| ~ ^ ~~~~~
<source>:3:10: note: candidate function [with N = 4UL, obj:auto = A &]
3 | void operator+=(this auto &&obj, const char (&c)[N]) {
| ^
<source>:5:10: note: candidate function [with obj:auto = A &, c:auto = const char (&)[4]]
5 | void operator+=(this auto &&obj, auto &&c) {
| ^
1 error generated.
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"rejects-valid