Record if a compound literal expression is @ file scope. This allows us to implement C99 6.5.2.5p6. This could have been done without modifying the AST (by checking the decl type and passing the info down to isContextExpr), however we concluded this is more desirable.
Bug/patch by Eli Friedman!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45966 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/compound-literal.c b/test/Sema/compound-literal.c
index 12ee9f9..1a03945 100644
--- a/test/Sema/compound-literal.c
+++ b/test/Sema/compound-literal.c
@@ -11,6 +11,9 @@
static int *p2 = (int []){2,x}; // -expected-error {{initializer element is not constant}}
static int *p3 = (int []){2,"x"}; // -expected-warning {{incompatible pointer to integer conversion initializing 'char *', expected 'int'}}
+typedef struct Test {int a;int b;} Test;
+static Test* ll = &(Test) {0,0};
+
extern void fooFunc(struct foo *pfoo);
int main(int argc, char **argv) {