forked from OSchip/llvm-project
-Wdeprecated: SavedInstanceContext is returned by value but isn't really copyable, but it can be made movable
llvm-svn: 244826
This commit is contained in:
parent
295282e0ab
commit
8533e96e42
|
@ -182,15 +182,20 @@ struct AccessTarget : public AccessedEntity {
|
||||||
|
|
||||||
class SavedInstanceContext {
|
class SavedInstanceContext {
|
||||||
public:
|
public:
|
||||||
|
SavedInstanceContext(SavedInstanceContext &&S)
|
||||||
|
: Target(S.Target), Has(S.Has) {
|
||||||
|
S.Target = nullptr;
|
||||||
|
}
|
||||||
~SavedInstanceContext() {
|
~SavedInstanceContext() {
|
||||||
Target.HasInstanceContext = Has;
|
if (Target)
|
||||||
|
Target->HasInstanceContext = Has;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend struct AccessTarget;
|
friend struct AccessTarget;
|
||||||
explicit SavedInstanceContext(AccessTarget &Target)
|
explicit SavedInstanceContext(AccessTarget &Target)
|
||||||
: Target(Target), Has(Target.HasInstanceContext) {}
|
: Target(&Target), Has(Target.HasInstanceContext) {}
|
||||||
AccessTarget &Target;
|
AccessTarget *Target;
|
||||||
bool Has;
|
bool Has;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue