Open porglezomp opened 1 year ago
@llvm/issue-subscribers-clang-frontend
I don't know if this is a duplicate but looks very similar to: https://github.com/llvm/llvm-project/issues/27443
They're both caused by the builtins handling more cases than the builtin overload sets, but will have different fixes. It hits this if the added overloads (especially the added builtin overloads) don't contain a viable operator, but then the actual implementation of the builtin accepts the types.
For the shift case, no operators were generating vector/scalar overloads, but the shift builtin handled the vector/enum.
Here is another asserting test case that appears to be the same problem:
typedef int vint __attribute__((__vector_size__(16)));
struct S {
int operator+(int r);
};
void f() {
S s;
vint v;
(void)(s+v);
}
Clang hits an assertion when trying to compile an
ext_vector_type << enum
. Example reduced case:```console Assertion failed: Result.isInvalid() && "C++ binary operator overloading is missing candidates!", file C:\Users\acct\Development\llvm-project\clang\lib\Sema\SemaOverload.cpp, line 14233 ```
```console PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump: 0. Program arguments: C:\\Users\\acct\\Development\\llvm-project\\build\\bin\\clang.exe -c C:\\tmp\\minimal.cpp 1. C:\tmp\minimal.cpp:6:18: current parser token ';' 2. C:\tmp\minimal.cpp:5:26: parsing function body 'shift' 3. C:\tmp\minimal.cpp:5:26: in compound statement ('{}') Exception Code: 0x80000003 #0 0x00007ff76e853f55 HandleAbort C:\Users\acct\Development\llvm-project\llvm\lib\Support\Windows\Signals.inc:419:0 #1 0x00007ffe29531881 (C:\windows\System32\ucrtbase.dll+0x71881) #2 0x00007ffe29532851 (C:\windows\System32\ucrtbase.dll+0x72851) #3 0x00007ffe2953426e (C:\windows\System32\ucrtbase.dll+0x7426e) #4 0x00007ffe29534165 (C:\windows\System32\ucrtbase.dll+0x74165) #5 0x00007ffe295344f1 (C:\windows\System32\ucrtbase.dll+0x744f1) #6 0x00007ff7718e0bb8 llvm::ArrayRef