Issue 176633
Summary static assertion is not an integral constant _expression_ on an attempt to execute check with a constexpr function
Labels new issue
Assignees
Reporter sat0sh1c
    I am trying to check whether a certain array element is equal to another compile‑time string, but Clang doesn't allow me to do so:

```cpp
#include <array>
#include <cstring>

constexpr std::array ARGS = {"--verbose"};

int main()
{
    static_assert(std::strcmp(ARGS[0], "--verbose") == 0);
}
```

The following piece of code compiles fine with [GCC](https://godbolt.org/z/5Td9zj3P1), but Clang fails to compile it.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to