[clang] [SemaCXX] Implement CWG2351 `void{}` (PR #78060)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 13 11:29:39 PST 2024


Endilll wrote:

> Initializer list syntax isn't available in C++98 mode (even as an extension? I can't find the option)

I'm not confident enough to properly review your changes, but my line of thinking is the following: `void()` is available in all language modes, but you're adding C++11-specific functionality (as uniform initializer syntax is not a thing in 98) without ever checking language mode. This sound suspicious enough to me to bring attention to, even if there are other reasons why it's not really necessary to check language mode here (which I'm not aware of, but my knowledge is limited).

> Even so, as a defect report it should apply to all prior C++ versions.

Formally, defect reports apply to then latest publication, which is C++14, if not 17. Implementation indeed try to backport them as far back as they reasonably can. Start accepting uniform initialization syntax in 98 mode because of `void{}` DR doesn't sound reasonable to me.

https://github.com/llvm/llvm-project/pull/78060


More information about the cfe-commits mailing list