blob: 802ed4628d9e55e643e9dcc486816476c729368e [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -emit-llvm-only -verify
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Eli Friedman49e2b8e2009-11-14 03:40:14 +00003// PR5489
4
5template<typename E>
6struct Bar {
7 int x_;
8};
9
10static struct Bar<int> bar[1] = {
11 { 0 }
12};
13
Chris Lattner3a2b6572011-07-12 06:52:18 +000014
15
16namespace incomplete_type_refs {
17 struct A;
18 extern A g[];
19 void foo(A*);
20 void f(void) {
21 foo(g); // Reference to array with unknown element type.
22 }
23
24 struct A { // define the element type.
25 int a,b,c;
26 };
27
28 A *f2() {
29 return &g[1];
30 }
31
Chris Lattner410b12e2011-07-20 04:31:01 +000032}
33
34namespace PR10395 {
35 struct T;
36 extern T x[];
37 T* f() { return x; }
38}
Chris Lattner01c5d1d2011-07-22 06:27:26 +000039
40namespace PR10384 {
41 struct X;
42 extern X x[1];
43 X* f() { return x; }
44}