[PATCH] D106216: Disallow narrowing conversions to bool in noexcept specififers.
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 6 06:45:47 PDT 2021
aaron.ballman 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));
----------------
cor3ntin wrote:
> 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
I kinda figured that was the case, thanks for confirming!
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