Issue 145190
Summary Catching function types turns into catching their respective pointers
Labels new issue
Assignees
Reporter Alcaro
    ```c++
template<typename T>
void fn()
{
 try {}
    catch (T) {}
}
int main() { fn<int(int)>(); }
```

https://godbolt.org/z/K8rdsKbMT

Expected: Error. T is a function type, can't have a variable like that.

Actual: Clang thinks it says catch (T\*), as can be seen if you add a second catch. https://godbolt.org/z/q7T43oW6n

(Fun fact: GCC is equally wrong in the opposite direction, by erroring so hard it segfaults. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120754)
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to