[all-commits] [llvm/llvm-project] 9bb28a: [C2x] Update 'nullptr' implementation based on CD ...

Aaron Ballman via All-commits all-commits at lists.llvm.org
Wed May 3 11:50:32 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9bb28a18d962e8f6e3fa8f48bd2c6dc183154d26
      https://github.com/llvm/llvm-project/commit/9bb28a18d962e8f6e3fa8f48bd2c6dc183154d26
  Author: Aaron Ballman <aaron at aaronballman.com>
  Date:   2023-05-03 (Wed, 03 May 2023)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaExpr.cpp
    M clang/test/C/C2x/n3042.c
    A clang/test/CodeGen/nullptr.c
    M clang/test/Sema/nullptr.c
    M clang/www/c_status.html

  Log Message:
  -----------
  [C2x] Update 'nullptr' implementation based on CD comments

We filed some CD ballot comments which WG14 considered during the
ballot comment resolution meetings in Jan and Feb 2023, and this
updates our implementation based on the decisions reached. Those
decisions were (paraphrased for brevity):

US 9-034 (REJECTED)
  allow (void *)nullptr to be a null pointer constant
US 10-035 (ACCEPTED)
  accept the following code, as in C++:
  void func(nullptr_t); func(0);
US 22-058 (REJECTED)
  accept the following code, as in C++:
  nullptr_t val; (void)(1 ? val : 0); (void)(1 ? nullptr : 0);
US 23-062 (REJECTED)
  reject the following code, as in C++:
  nullptr_t val; bool b1 = val; bool b2 = nullptr;
US 24-061 (ACCEPTED)
  accept the following code, as in C++:
  nullptr_t val; val = 0;
US 21-068 (ACCEPTED)
  accept the following code, as in C++:
  (nullptr_t)nullptr;
GB-071 (ACCEPTED)
  accept the following code, as in C++:
  nullptr_t val; (void)(val == nullptr);

This patch updates the implementation as appropriate, but is primarily
focused around US 10-035, US 24-061, and US 23-062 in terms of
functional changes.

Differential Revision: https://reviews.llvm.org/D148800




More information about the All-commits mailing list