summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-02-05 19:11:37 +0000
committerDouglas Gregor <dgregor@apple.com>2010-02-05 19:11:37 +0000
commit7df89f5d180ddab85face93dfebe2be14b6f6bc8 (patch)
treecb41cdc1de783680c5ad6abb3681342d687a7471 /clang/lib/Sema/SemaExprCXX.cpp
parent37166eb419ed10e15c99ebbd5450059ed7b1e534 (diff)
downloadbcm5719-llvm-7df89f5d180ddab85face93dfebe2be14b6f6bc8.tar.gz
bcm5719-llvm-7df89f5d180ddab85face93dfebe2be14b6f6bc8.zip
When we're parsing an expression that may have looked like a
declaration, we can end up with template-id annotation tokens for types that have not been converted into type annotation tokens. When this is the case, translate the template-id into a type and parse as an expression. llvm-svn: 95404
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 90331378985..2d6bfb433e5 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -194,7 +194,9 @@ Sema::ActOnCXXTypeConstructExpr(SourceRange TypeRange, TypeTy *TypeRep,
MultiExprArg exprs,
SourceLocation *CommaLocs,
SourceLocation RParenLoc) {
- assert(TypeRep && "Missing type!");
+ if (!TypeRep)
+ return ExprError();
+
TypeSourceInfo *TInfo;
QualType Ty = GetTypeFromParser(TypeRep, &TInfo);
if (!TInfo)
OpenPOWER on IntegriCloud