aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReaderStmt.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-13 15:54:32 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-13 15:54:32 +0000
commit4bd40318cbea15310a37343db46de96c4fcc15e6 (patch)
treee77167e0d7eecd0192a31c03d8f5fc206fec6c72 /lib/Frontend/PCHReaderStmt.cpp
parent9b36c3f0de0105e903130bbda3c4aea7d792c0af (diff)
Downgrade the "when type is in parentheses, array cannot have dynamic
size" error for code like new (int [size]) to a warning, add a Fix-It to remove the parentheses, and make this diagnostic work properly when it occurs in a template instantiation. <rdar://problem/8018245>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108242 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReaderStmt.cpp')
-rw-r--r--lib/Frontend/PCHReaderStmt.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Frontend/PCHReaderStmt.cpp b/lib/Frontend/PCHReaderStmt.cpp
index f6313633f5..ace62d787e 100644
--- a/lib/Frontend/PCHReaderStmt.cpp
+++ b/lib/Frontend/PCHReaderStmt.cpp
@@ -1042,7 +1042,6 @@ void PCHStmtReader::VisitCXXScalarValueInitExpr(CXXScalarValueInitExpr *E) {
void PCHStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
VisitExpr(E);
E->setGlobalNew(Record[Idx++]);
- E->setParenTypeId(Record[Idx++]);
E->setHasInitializer(Record[Idx++]);
bool isArray = Record[Idx++];
unsigned NumPlacementArgs = Record[Idx++];
@@ -1052,6 +1051,10 @@ void PCHStmtReader::VisitCXXNewExpr(CXXNewExpr *E) {
cast_or_null<FunctionDecl>(Reader.GetDecl(Record[Idx++])));
E->setConstructor(
cast_or_null<CXXConstructorDecl>(Reader.GetDecl(Record[Idx++])));
+ SourceRange TypeIdParens;
+ TypeIdParens.setBegin(SourceLocation::getFromRawEncoding(Record[Idx++]));
+ TypeIdParens.setEnd(SourceLocation::getFromRawEncoding(Record[Idx++]));
+ E->TypeIdParens = TypeIdParens;
E->setStartLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
E->setEndLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));