Skip to content
Snippets Groups Projects
Commit 773ba375 authored by DeLesley Hutchins's avatar DeLesley Hutchins
Browse files

Fix for PR20402 in -Wconsumed.

https://llvm.org/bugs/show_bug.cgi?id=20402
Patch by Chris Wailes.

llvm-svn: 235051
parent 62e0f454
No related branches found
No related tags found
No related merge requests found
......@@ -1442,7 +1442,7 @@ void ConsumedAnalyzer::run(AnalysisDeclContext &AC) {
CurrStates,
WarningsHandler);
if (BlockInfo.allBackEdgesVisited(*SI, CurrBlock))
if (BlockInfo.allBackEdgesVisited(CurrBlock, *SI))
BlockInfo.discardInfo(*SI);
} else {
BlockInfo.addInfo(*SI, CurrStates, OwnershipTaken);
......
......@@ -638,6 +638,18 @@ void testWhileLoop1() {
*var0; // expected-warning {{invalid invocation of method 'operator*' on object 'var0' while it is in the 'consumed' state}}
}
// Tests if state information is correctly discarded for certain shapes of CFGs.
void testSwitchGOTO(void) {
int a;
LABEL0:
switch (a)
case 0:
goto LABEL0;
goto LABEL0;
}
typedef const int*& IntegerPointerReference;
void testIsRValueRefishAndCanonicalType(IntegerPointerReference a) {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment