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
2 changes: 2 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ Bug Fixes to Attribute Support

- ``[[nodiscard]]`` is now respected on Objective-C and Objective-C++ methods.
(#GH141504)
- Fixed a crash in the static analyzer that when the expression in an
``[[assume(expr)]]`` attribute was enclosed in parentheses. (#GH151529)

Bug Fixes to C++ Support
^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ void ExprEngine::VisitAttributedStmt(const AttributedStmt *A,

for (const auto *Attr : getSpecificAttrs<CXXAssumeAttr>(A->getAttrs())) {
for (ExplodedNode *N : CheckerPreStmt) {
Visit(Attr->getAssumption(), N, EvalSet);
Visit(Attr->getAssumption()->IgnoreParens(), N, EvalSet);
}
}

Expand Down
15 changes: 15 additions & 0 deletions clang/test/Analysis/issue-151529.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// RUN: %clang_analyze_cc1 -std=c++23 -analyzer-checker=cplusplus -verify %s
// expected-no-diagnostics

template <int ...args>
bool issue151529()
{
[[assume (((args >= 0) && ...))]];
return ((args >= 0) && ...);
}

int main() {
issue151529();
[[assume((true))]]; // crash
return 0;
}
Loading