[llvm-bugs] [Bug 38145] New: Implicit conversion of nullptr to bool
via llvm-bugs
llvm-bugs at lists.llvm.org
Wed Jul 11 19:49:46 PDT 2018
https://bugs.llvm.org/show_bug.cgi?id=38145
Bug ID: 38145
Summary: Implicit conversion of nullptr to bool
Product: clang
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: zhonghao at pku.org.cn
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
DR 1423 has now reached ready status,
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1423
so this seems like a good reason to consider a compiler change to evaluate
potential code breakages.
bool b1 = nullptr; // Is well-formed today, needs to be ill-formed
I tried clang++ and g++. clang++ accepts the above code, but g++ rejects it:
error:converting to ‘bool’ from ‘std::nullptr_t’ requires direct-initialization
[-fpermissive]
bool b1 = nullptr; // Is well-formed today, needs to be ill-formed
^~~~~~~
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180712/9fd37f02/attachment.html>
More information about the llvm-bugs
mailing list