llvm-project/lldb/scripts/clang.instantiate-complete-type.diff
Sean Callanan 7f27d6044e Pulled in a new revision of LLVM/Clang and added
several patches.  These patches fix a problem
where templated types were not being completed the
first time they were used, and fix a variety of
minor issues I discovered while fixing that problem.

One of the previous local patches was resolved in
the most recent Clang, so I removed it.  The others
will be removed in due course.

llvm-svn: 144984
2011-11-19 02:54:21 +00:00

16 lines
634 B
Diff

Index: lib/Sema/SemaTemplateInstantiate.cpp
===================================================================
--- lib/Sema/SemaTemplateInstantiate.cpp (revision 144982)
+++ lib/Sema/SemaTemplateInstantiate.cpp (working copy)
@@ -1683,6 +1683,10 @@
TemplateSpecializationKind TSK,
bool Complain) {
bool Invalid = false;
+
+ RequireCompleteType(Pattern->getLocation(),
+ QualType(Pattern->getTypeForDecl(), 0),
+ diag::err_incomplete_type);
CXXRecordDecl *PatternDef
= cast_or_null<CXXRecordDecl>(Pattern->getDefinition());