// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -g -emit-llvm -o - | FileCheck %s
// This test is for a crash when emitting debug info for not-yet-completed types.
// Test that we don't actually emit a forward decl for the offending class:
// CHECK:  [ DW_TAG_class_type ] [Derived<Foo>] {{.*}} [def]
// rdar://problem/15931354
template <class R> class Returner {};
template <class A> class Derived;

template <class A>
class Base
{
  static Derived<A>* create();
};

template <class A>
class Derived : public Base<A> {
public:
  static void foo();
};

class Foo
{
  Foo();
  static Returner<Base<Foo> > all();
};

Foo::Foo(){}

Returner<Base<Foo> > Foo::all()
{
  Derived<Foo>::foo();
  return Foo::all();
}

// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -g -emit-llvm -o - | FileCheck %s
// This test is for a crash when emitting debug info for not-yet-completed types.
// Test that we don't actually emit a forward decl for the offending class:
// CHECK:  [ DW_TAG_class_type ] [Derived<const __CFString, Foo>] {{.*}} [def]
// rdar://problem/15931354
typedef const struct __CFString * CFStringRef;
template <class R> class Returner {};
typedef const __CFString String;

template <class A, class B> class Derived;

template <class A, class B>
class Base
{
  static Derived<A, B>* create();
};

template <class A, class B>
class Derived : public Base<A, B> {
public:
  static void foo();
};

class Foo
{
  Foo();
  static Returner<Base<String,Foo> > all();
};

Foo::Foo(){}

Returner<Base<String,Foo> > Foo::all()
{
  Derived<String,Foo>::foo();
  return Foo::all();
}

--- 
+++ 
@@ -1,22 +1,19 @@
 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin -g -emit-llvm -o - | FileCheck %s
 // This test is for a crash when emitting debug info for not-yet-completed types.
 // Test that we don't actually emit a forward decl for the offending class:
-// CHECK:  [ DW_TAG_class_type ] [Derived<const __CFString, Foo>] {{.*}} [def]
+// CHECK:  [ DW_TAG_class_type ] [Derived<Foo>] {{.*}} [def]
 // rdar://problem/15931354
-typedef const struct __CFString * CFStringRef;
 template <class R> class Returner {};
-typedef const __CFString String;
+template <class A> class Derived;
 
-template <class A, class B> class Derived;
-
-template <class A, class B>
+template <class A>
 class Base
 {
-  static Derived<A, B>* create();
+  static Derived<A>* create();
 };
 
-template <class A, class B>
-class Derived : public Base<A, B> {
+template <class A>
+class Derived : public Base<A> {
 public:
   static void foo();
 };
@@ -24,13 +21,13 @@
 class Foo
 {
   Foo();
-  static Returner<Base<String,Foo> > all();
+  static Returner<Base<Foo> > all();
 };
 
 Foo::Foo(){}
 
-Returner<Base<String,Foo> > Foo::all()
+Returner<Base<Foo> > Foo::all()
 {
-  Derived<String,Foo>::foo();
+  Derived<Foo>::foo();
   return Foo::all();
 }
Simplify testcase from r200797 some more.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@200798 91177308-0d34-0410-b5e6-96231b3b80d8
