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

Mital Ashok via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 13 12:02:31 PST 2024


MitalAshok wrote:

Looking at other places, it looks like init-list stuff is guarded behind `getLangOpts().CPlusPlus11`, so I'll add that check.

It looks like this DR is CD5 (after C++17, applies to C++17), but `void{}` in C++11/14 without a warning seems fine.

As for "regular tests", do you mean in [`/clang/test/CXX`](https://github.com/llvm/llvm-project/tree/main/clang/test/CXX)? Should I also add tests there?

I also found this: https://stackoverflow.com/q/41131806 that `void({})` apparently used to (erroneously) be accepted in Clang 3.8 but I can't find any tests for it

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


More information about the cfe-commits mailing list