Index: cfe/trunk/lib/Sema/TreeTransform.h =================================================================== --- cfe/trunk/lib/Sema/TreeTransform.h +++ cfe/trunk/lib/Sema/TreeTransform.h @@ -5932,7 +5932,6 @@ } ObjCObjectTypeLoc NewT = TLB.push(Result); - assert(TL.hasBaseTypeAsWritten() && "Can't be dependent"); NewT.setHasBaseTypeAsWritten(true); NewT.setTypeArgsLAngleLoc(TL.getTypeArgsLAngleLoc()); for (unsigned i = 0, n = TL.getNumTypeArgs(); i != n; ++i) Index: cfe/trunk/test/SemaObjCXX/base-type-as-written.mm =================================================================== --- cfe/trunk/test/SemaObjCXX/base-type-as-written.mm +++ cfe/trunk/test/SemaObjCXX/base-type-as-written.mm @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// Make sure we don't crash in TreeTransform::TransformObjCObjectType. + +@protocol P1 +@end + +template foo1(T1) { // expected-warning {{protocol has no object type specified; defaults to qualified 'id'}} + foo1(0); +}