Skip to content

Commit efb5831

Browse files
authored
[Clang] Prevent Copying of LateParsedClass Instances (#109428)
Class clang::Parser::LateParsedClass owns resources that are freed in its destructor but has no user-written assignment operator. This commit explicitly deletes the copy constructor and copy assignment operator for the LateParsedClass.
1 parent 739ede4 commit efb5831

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/include/clang/Parse/Parser.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,10 @@ class Parser : public CodeCompletionHandler {
13551355
void ParseLexedAttributes() override;
13561356
void ParseLexedPragmas() override;
13571357

1358+
// Delete copy constructor and copy assignment operator.
1359+
LateParsedClass(const LateParsedClass &) = delete;
1360+
LateParsedClass &operator=(const LateParsedClass &) = delete;
1361+
13581362
private:
13591363
Parser *Self;
13601364
ParsingClass *Class;

0 commit comments

Comments
 (0)