Open listout opened 1 year ago
@llvm/issue-subscribers-clang-frontend
As far as I understand 6.6 Constant expressions this is a gcc extension and clang is strictly correct to reject this but I would have expected them to diagnose this in pedantic mode. gcc does diagnose this is version 7.5 though.
CC @AaronBallman
Yeah, that is an extension even in C2x (though the constexpr
feature in C2x could be used to make this code compile, but that won't help for C17 and earlier). So this isn't a bug, but is a reasonable feature request.
@llvm/issue-subscribers-c
I came across this while building gnome-remote-desktop on Gentoo with clang 16. Relevant bug: https://bugs.gentoo.org/885875.
Minimal reproducible code:
With Clang, I get the following output
While with GCC, it builds successfully.