Mark invalid RecordDecls as completed.
authorErik Verbruggen <erikjv@me.com>
Thu, 27 Oct 2016 08:37:14 +0000 (08:37 +0000)
committerErik Verbruggen <erikjv@me.com>
Thu, 27 Oct 2016 08:37:14 +0000 (08:37 +0000)
commit52b26713bebf3a6724d924a10719fb9ab936e694
treeae8f5170b1a8893464e540f4053ce68ffe2b2f2a
parentdd680cc753f4874cc5bd1e4680676cb6c3f5f8df
Mark invalid RecordDecls as completed.

Sema::ActOnTag creates TagDecls for records. However, if those record
declarations are invalid, and the parser is in C++ mode, it would
silently drop the TagDecl (and leave it as "beingDefined"). The problem
is that other code (e.g. the ASTWriter) will serialize all types, and
expects them to be complete. So, leaving them open would result in
failing asserts.

Fixes PR20320

Differential Revision: http://reviews.llvm.org/D21176

llvm-svn: 285275
clang/lib/Sema/SemaDecl.cpp
clang/test/Index/pr20320.cpp [new file with mode: 0644]
clang/test/Index/pr20320.h [new file with mode: 0644]
clang/test/SemaCXX/conversion-function.cpp