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

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 6 06:40:08 PDT 2021


cor3ntin added inline comments.


================
Comment at: clang/unittests/ASTMatchers/ASTMatchersNodeTest.cpp:879
   EXPECT_TRUE(notMatches("void foo() noexcept;", NoExcept));
-  EXPECT_TRUE(notMatches("void foo() noexcept(1+1);", NoExcept));
+  EXPECT_TRUE(notMatches("void foo() noexcept(0+1);", NoExcept));
   EXPECT_TRUE(matches("void foo() noexcept(noexcept(1+1));", NoExcept));
----------------
aaron.ballman wrote:
> Was there a reason this test needed to change?
yup, 2 is not convertible to bool here. I use 0+1 to keep the kind of expression the same


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106216



More information about the cfe-commits mailing list