-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Open
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"extension:microsoft
Description
x86-64 clang 19.1.0 issues a compilation error for the following example:
- cat ex.cpp
struct value {
public:
operator int() const;
struct value &operator[](const char * __ptr32 _param_1);
};
extern struct value *new_value();
int json_send_error(int status)
{
struct value * v = new_value();
(void)(*v)["error"];
return 0;
}
- clang ex.cpp -fms-extensions -S
ex.cpp:13:13: error: use of overloaded operator '[]' is ambiguous (with operand types 'struct value' and 'const char[6]')
13 | (void)(*v)["error"];
| ~~~~^~~~~~~~
ex.cpp:5:23: note: candidate function
5 | struct value &operator[](const char * __ptr32 _param_1);
| ^
ex.cpp:13:13: note: built-in candidate operator[](long, const char *)
13 | (void)(*v)["error"];
| ^
1 error generated.
https://godbolt.org/z/dbvEGfz13
x64 MSVC v.19 compiles successfully https://godbolt.org/z/qWc584f5f
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"extension:microsoft