Skip to content
Snippets Groups Projects
Commit c23e69d7 authored by David Greene's avatar David Greene
Browse files

Fix Cast Code

Eliminate a cast and resulting cast-qual warning by using a temporary
as the target of memcpy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172557 91177308-0d34-0410-b5e6-96231b3b80d8
parent 6b716c58
No related branches found
No related tags found
No related merge requests found
......@@ -772,9 +772,10 @@ void DeclSpec::setProtocolQualifiers(Decl * const *Protos,
SourceLocation *ProtoLocs,
SourceLocation LAngleLoc) {
if (NP == 0) return;
ProtocolQualifiers = new Decl*[NP];
Decl **ProtoQuals = new Decl*[NP];
memcpy(ProtoQuals, Protos, sizeof(Decl*)*NP);
ProtocolQualifiers = ProtoQuals;
ProtocolLocs = new SourceLocation[NP];
memcpy((void*)ProtocolQualifiers, Protos, sizeof(Decl*)*NP);
memcpy(ProtocolLocs, ProtoLocs, sizeof(SourceLocation)*NP);
NumProtocolQualifiers = NP;
ProtocolLAngleLoc = LAngleLoc;
......
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