[cfe-commits] r134276 - in /cfe/trunk: lib/Sema/SemaType.cpp test/SemaObjCXX/arc-type-conversion.mm
Argyrios Kyrtzidis
akyrtzi at gmail.com
Fri Jul 1 15:23:03 PDT 2011
Author: akirtzidis
Date: Fri Jul 1 17:23:03 2011
New Revision: 134276
URL: http://llvm.org/viewvc/llvm-project?rev=134276&view=rev
Log:
Fix assertion hit in inferARCWriteback.
Modified:
cfe/trunk/lib/Sema/SemaType.cpp
cfe/trunk/test/SemaObjCXX/arc-type-conversion.mm
Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=134276&r1=134275&r2=134276&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Fri Jul 1 17:23:03 2011
@@ -1644,8 +1644,9 @@
// Look for an explicit lifetime attribute there.
DeclaratorChunk &chunk = declarator.getTypeObject(outermostPointerIndex);
- assert(chunk.Kind == DeclaratorChunk::Pointer ||
- chunk.Kind == DeclaratorChunk::BlockPointer);
+ if (chunk.Kind != DeclaratorChunk::Pointer &&
+ chunk.Kind != DeclaratorChunk::BlockPointer)
+ return;
for (const AttributeList *attr = chunk.getAttrs(); attr;
attr = attr->getNext())
if (attr->getKind() == AttributeList::AT_objc_ownership)
Modified: cfe/trunk/test/SemaObjCXX/arc-type-conversion.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/arc-type-conversion.mm?rev=134276&r1=134275&r2=134276&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/arc-type-conversion.mm (original)
+++ cfe/trunk/test/SemaObjCXX/arc-type-conversion.mm Fri Jul 1 17:23:03 2011
@@ -215,3 +215,6 @@
Block_strong blk_strong2 = static_cast<Block>(blk_strong1);
Block_autoreleasing *blk_auto = static_cast<Block*>(pblk);
}
+
+// Make sure we don't crash.
+void writeback_test(NSString & &) {} // expected-error {{type name declared as a reference to a reference}}
More information about the cfe-commits
mailing list