[clang] [Clang] CWG722: nullptr to ellipses (PR #104704)

Mital Ashok via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 18 07:18:39 PDT 2024


================
@@ -0,0 +1,56 @@
+// RUN: %clang_cc1 -std=c++98 %s -verify -pedantic-errors
+// RUN: %clang_cc1 -std=c++11 %s -verify -pedantic-errors -ast-dump | FileCheck %s
+// RUN: %clang_cc1 -std=c++14 %s -verify -pedantic-errors -ast-dump | FileCheck %s
+// RUN: %clang_cc1 -std=c++17 %s -verify -pedantic-errors -ast-dump | FileCheck %s
+// RUN: %clang_cc1 -std=c++20 %s -verify -pedantic-errors -ast-dump | FileCheck %s
+// RUN: %clang_cc1 -std=c++23 %s -verify -pedantic-errors -ast-dump | FileCheck %s
+// RUN: %clang_cc1 -std=c++26 %s -verify -pedantic-errors -ast-dump | FileCheck %s
+
+// expected-no-diagnostics
+// cwg722: 20
----------------
MitalAshok wrote:

The difference is there is no `ImplicitCastExpr` to `void*` in the AST: https://godbolt.org/z/9dcT8Tzs4

This does not change the behaviour for the first few arguments, but the last two arguments can no longer pass `nullptr` with non-zero bit patterns.

This has differences at runtime if `nullptr` prvalues are passed to a variadic function: https://godbolt.org/z/19vovz8o6

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


More information about the cfe-commits mailing list