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 {
|
||||
public:
|
||||
SavedInstanceContext(SavedInstanceContext &&S)
|
||||
: Target(S.Target), Has(S.Has) {
|
||||
S.Target = nullptr;
|
||||
}
|
||||
~SavedInstanceContext() {
|
||||
Target.HasInstanceContext = Has;
|
||||
if (Target)
|
||||
Target->HasInstanceContext = Has;
|
||||
}
|
||||
|
||||
private:
|
||||
friend struct AccessTarget;
|
||||
explicit SavedInstanceContext(AccessTarget &Target)
|
||||
: Target(Target), Has(Target.HasInstanceContext) {}
|
||||
AccessTarget &Target;
|
||||
: Target(&Target), Has(Target.HasInstanceContext) {}
|
||||
AccessTarget *Target;
|
||||
bool Has;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue