Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 %s -emit-llvm-only -verify
      2 // PR5489
      3 
      4 template<typename E>
      5 struct Bar {
      6  int x_;
      7 };
      8 
      9 static struct Bar<int> bar[1] = {
     10   { 0 }
     11 };
     12 
     13 
     14 
     15 namespace incomplete_type_refs {
     16   struct A;
     17   extern A g[];
     18   void foo(A*);
     19   void f(void) {
     20     foo(g);    // Reference to array with unknown element type.
     21   }
     22 
     23   struct A {   // define the element type.
     24     int a,b,c;
     25   };
     26 
     27   A *f2() {
     28     return &g[1];
     29   }
     30 
     31 }
     32 
     33 namespace PR10395 {
     34   struct T;
     35   extern T x[];
     36   T* f() { return x; }
     37 }
     38 
     39 namespace PR10384 {
     40   struct X;
     41   extern X x[1];
     42   X* f() { return x; }
     43 }
     44