[PATCH] D106216: Disallow narrowing conversions to bool in explicit specififers.

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 22 08:45:31 PDT 2021


cor3ntin updated this revision to Diff 360840.
cor3ntin added a comment.

It turns out that explicit was doing the right thing (as outlined in P1401 <https://reviews.llvm.org/P1401>),
but noexcept was not.

I've reworked the handling of noexcept so that noexcept and explicit specifier
use the same code paths, as they have the same expected behavior and wording.
This also make sure their diagnostics are consistent.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106216/new/

https://reviews.llvm.org/D106216

Files:
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/Sema/SemaExceptionSpec.cpp
  clang/lib/Sema/SemaOverload.cpp
  clang/test/CXX/except/except.spec/p1.cpp
  clang/test/SemaCXX/cxx0x-noexcept-expression.cpp
  clang/test/SemaCXX/cxx2a-explicit-bool.cpp
  clang/test/SemaTemplate/instantiate-exception-spec-cxx11.cpp
  clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp
  clang/www/cxx_status.html

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106216.360840.patch
Type: text/x-patch
Size: 10358 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210722/07c97306/attachment.bin>


More information about the cfe-commits mailing list