aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-01 21:51:26 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-01 21:51:26 +0000
commit31a19b6989bbf326d2de5ae12e712e2a65ca9c34 (patch)
treee79ad32f23a5f590558c274cf11b000f10b04042 /lib/Sema/SemaTemplate.cpp
parentfaa435a326a694e0517d035376e616ff82655fe5 (diff)
Make parsing a semantic analysis a little more robust following Sema
failures that involve malformed types, e.g., "typename X::foo" where "foo" isn't a type, or "std::vector<void>" that doens't instantiate properly. Similarly, be a bit smarter in our handling of ambiguities that occur in Sema::getTypeName, to eliminate duplicate error messages about ambiguous name lookup. This eliminates two XFAILs in test/SemaCXX, one of which was crying out to us, trying to tell us that we were producing repeated error messages. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68251 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 5db19a59ac..abc3ac08e9 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -870,8 +870,11 @@ Sema::ActOnTemplateIdType(TemplateTy TemplateD, SourceLocation TemplateLoc,
QualType Result = CheckTemplateIdType(Template, TemplateLoc, LAngleLoc,
&TemplateArgs[0], TemplateArgs.size(),
RAngleLoc);
-
TemplateArgsIn.release();
+
+ if (Result.isNull())
+ return true;
+
return Result.getAsOpaquePtr();
}
@@ -2102,6 +2105,8 @@ Sema::ActOnTypenameType(SourceLocation TypenameLoc, const CXXScopeSpec &SS,
return true;
QualType T = CheckTypenameType(NNS, II, SourceRange(TypenameLoc, IdLoc));
+ if (T.isNull())
+ return true;
return T.getAsOpaquePtr();
}