This is an archive of the discontinued LLVM Phabricator instance.

Fix destructor definition of invalid classes
ClosedPublic

Authored by ogoffart on Mar 9 2016, 4:49 AM.

Details

Summary

The declaration of the destructor of an invalid class was not properly marked
as noexcept. As a result, the definition of the same destructor, which was
properly implicitly marked as noexcept, would not match the definition.
This would cause the definition CXXDestructorDecl to be matked as invalid
and omited from the AST.

class Invalid {
  ~Invalid();
  UnknownType xx;
};

// The constructor definition should not have errors
Invalid::~Invalid() {}
// Before the patch, the error was  error: exception specification in declaration does not match previous declaration

Diff Detail

Repository
rL LLVM

Event Timeline

ogoffart updated this revision to Diff 50122.Mar 9 2016, 4:49 AM
ogoffart retitled this revision from to Fix destructor definition of invalid classes.
ogoffart updated this object.
ogoffart added a reviewer: rsmith.
ogoffart updated this object.Mar 9 2016, 4:53 AM
ogoffart updated this revision to Diff 50124.Mar 9 2016, 4:55 AM

(Removed a comment that should not have been part of the diff)

rjmccall edited edge metadata.Mar 15 2016, 11:35 AM

Seems okay to me.

This revision was automatically updated to reflect the committed changes.