Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LLVM bpEVL
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Albano
LLVM bpEVL
Commits
773ba375
Commit
773ba375
authored
9 years ago
by
DeLesley Hutchins
Browse files
Options
Downloads
Patches
Plain Diff
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
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clang/lib/Analysis/Consumed.cpp
+1
-1
1 addition, 1 deletion
clang/lib/Analysis/Consumed.cpp
clang/test/SemaCXX/warn-consumed-analysis.cpp
+12
-0
12 additions, 0 deletions
clang/test/SemaCXX/warn-consumed-analysis.cpp
with
13 additions
and
1 deletion
clang/lib/Analysis/Consumed.cpp
+
1
−
1
View file @
773ba375
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
clang/test/SemaCXX/warn-consumed-analysis.cpp
+
12
−
0
View file @
773ba375
...
...
@@ -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
)
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment