Skip to content

Commit

Permalink
[clang][ExtractAPI] Fix -Wpessimizing-move in DeclarationFragments.h …
Browse files Browse the repository at this point in the history
…(NFC)

/Users/jiefu/llvm-project/clang/include/clang/ExtractAPI/DeclarationFragments.h:118:26: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
    Fragments.insert(It, std::move(Fragment(Spelling, Kind, PreciseIdentifier,
                         ^
/Users/jiefu/llvm-project/clang/include/clang/ExtractAPI/DeclarationFragments.h:118:26: note: remove std::move call here
    Fragments.insert(It, std::move(Fragment(Spelling, Kind, PreciseIdentifier,
                         ^~~~~~~~~~
1 error generated.
  • Loading branch information
DamonFool committed May 30, 2023
1 parent 68ef0e9 commit 749aeea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clang/include/clang/ExtractAPI/DeclarationFragments.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class DeclarationFragments {
FragmentKind Kind,
StringRef PreciseIdentifier = "",
const Decl *Declaration = nullptr) {
Fragments.insert(It, std::move(Fragment(Spelling, Kind, PreciseIdentifier,
Declaration)));
Fragments.insert(It, Fragment(Spelling, Kind, PreciseIdentifier,
Declaration));
return *this;
}

Expand Down

0 comments on commit 749aeea

Please sign in to comment.