Issue 126270
Summary Clang does not diagnose an explicit specialization or partial specialization of initializer_list
Labels clang:frontend, accepts-invalid
Assignees
Reporter miyuki
    According to the C++ standard (C++23 [initializer.list.syn] paragraph 2):

> If an explicit specialization or partial specialization of `initializer_list` is declared, the program is ill-formed.

It does not say "no diagnostic is required"; therefore, I think Clang must produce an error, but it does not. Example code:

```
#include <initializer_list>

template<>
class std::initializer_list<int> {};

template<typename T>
class std::initializer_list<T*> {};
```

Clang (current trunk version) accepts the code with `-std=c++23 -pedantic-errors`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to