Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix false positive unsequenced access and modification warning in arr…
…ay subscript expression. Summary: In the [expr.sub] p1, we can read that for a given E1[E2], E1 is sequenced before E2. Patch by Mateusz Janek. Reviewers: rsmith, Rakete1111 Reviewed By: rsmith, Rakete1111 Subscribers: riccibruno, lebedev.ri, Rakete1111, hiraditya, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D50766 llvm-svn: 350874
- Loading branch information
1 parent
350e6e9
commit 5610cd8
Showing
3 changed files
with
37 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 -Wno-unused %s | ||
|
||
void test() { | ||
int xs[10]; | ||
int *p = xs; | ||
// expected-no-diagnostics | ||
p[(long long unsigned)(p = 0)]; // ok | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5610cd8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @stryku, you are the author of this patch. Are you willing to sign LLVM re-licensing agreement? See https://discourse.llvm.org/t/llvm-relicensing-update-further-suggestions-for-help/64667.