[all-commits] [llvm/llvm-project] 7ef45f: P1957R2: conversion from a pointer to bool is cons...

Richard Smith via All-commits all-commits at lists.llvm.org
Tue Feb 11 06:53:01 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ef45f45f6721af4942f0e0bc38329e236b468cd
      https://github.com/llvm/llvm-project/commit/7ef45f45f6721af4942f0e0bc38329e236b468cd
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-02-11 (Tue, 11 Feb 2020)

  Changed paths:
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp
    M clang/test/CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp

  Log Message:
  -----------
  P1957R2: conversion from a pointer to bool is considered narrowing.

This is being implemented somewhat speculatively, to match GCC's
behavior.


  Commit: 9ce6dc9872be4081fb98f6161c28581e1cbbe7dc
      https://github.com/llvm/llvm-project/commit/9ce6dc9872be4081fb98f6161c28581e1cbbe7dc
  Author: Richard Smith <richard at metafoo.co.uk>
  Date:   2020-02-11 (Tue, 11 Feb 2020)

  Changed paths:
    M clang/include/clang/Sema/Overload.h
    M clang/lib/Sema/SemaInit.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/test/CXX/drs/dr14xx.cpp
    M clang/test/CXX/drs/dr6xx.cpp
    M clang/test/CXX/expr/expr.const/p3-0x.cpp
    M clang/test/CodeGenCXX/nullptr.cpp
    M clang/test/SemaCXX/conversion.cpp
    M clang/test/SemaCXX/nullptr.cpp
    M clang/www/cxx_dr_status.html

  Log Message:
  -----------
  CWG1423: don't permit implicit conversion of nullptr_t to bool.

The C++ rules briefly allowed this, but the rule changed nearly 10 years
ago and we never updated our implementation to match. However, we've
warned on this by default for a long time, and no other compiler accepts
(even as an extension).


Compare: https://github.com/llvm/llvm-project/compare/db875f665544...9ce6dc9872be


More information about the All-commits mailing list