| Issue |
87235
|
| Summary |
Clang rejects valid out of class definition of a static const data member as constexpr
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
ranaanoop
|
Consider the following program and the comments given in there:
```
template<class T>
class C
{
public:
static const double mem;
static const int k;
};
template<class T>
constexpr double C<T>::mem{};
template<class T>
constexpr int C<T>::k{};
int main()
{
constexpr double i = C<double>::mem; //#1: gcc accepts but both clang and msvc rejcects
constexpr int j = C<double>::k; //#2: gcc and clang accepts but msvc rejects
}
```
As you can see clang accepts `2`([demo](https://godbolt.org/z/68xdvGrex)) but rejects `#1`([demo](https://godbolt.org/z/KvTfKzrMe))
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs