Don't mark a type specifier as "owned" if there is no declaration to own.
This simplifies error recovery elsewhere, eliminating the crash in
<rdar://problem/13853540>.
llvm-svn: 181846
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp
index 3b3ab2c..dfce324 100644
--- a/clang/lib/Sema/DeclSpec.cpp
+++ b/clang/lib/Sema/DeclSpec.cpp
@@ -651,7 +651,7 @@
DeclRep = Rep;
TSTLoc = TagKwLoc;
TSTNameLoc = TagNameLoc;
- TypeSpecOwned = Owned;
+ TypeSpecOwned = Owned && Rep != 0;
return false;
}