Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/lib/Analysis/Consumed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,9 @@ bool ConsumedAnalyzer::splitState(const CFGBlock *CurrBlock,

if (const auto *IfNode =
dyn_cast_or_null<IfStmt>(CurrBlock->getTerminator().getStmt())) {
if (IfNode->isConsteval())
return false;

const Expr *Cond = IfNode->getCond();

PInfo = Visitor.getInfo(Cond);
Expand Down
9 changes: 8 additions & 1 deletion clang/test/SemaCXX/constexpr-return-non-void-cxx2b.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -Wimplicit-fallthrough -verify %s
// RUN: %clang_cc1 -std=c++23 -fsyntax-only -Wimplicit-fallthrough -Wconsumed -verify %s

constexpr int f() { } // expected-warning {{non-void function does not return a value}}
static_assert(__is_same(decltype([] constexpr -> int { }( )), int)); // expected-warning {{non-void lambda does not return a value}}
Expand Down Expand Up @@ -34,3 +34,10 @@ constinit bool l = j(); // expected-error {{variable does not have a constant in
// expected-note {{in call to 'j()'}}

}

namespace GH117385 {
void f() {
if consteval {
}
}
}
Loading