wrap some long diagnostics, make 'initializer is not a constant' diagnostic
a bit more clear (rdar://5646070)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54606 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index c1a789e..7aecdda 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -4,8 +4,8 @@
static int x, y, z;
-static int ary[] = { x, y, z }; // expected-error{{initializer element is not constant}}
-int ary2[] = { x, y, z }; // expected-error{{initializer element is not constant}}
+static int ary[] = { x, y, z }; // expected-error{{initializer element is not a compile-time constant}}
+int ary2[] = { x, y, z }; // expected-error{{initializer element is not a compile-time constant}}
extern int fileScopeExtern[3] = { 1, 3, 5 }; // expected-warning{{'extern' variable has an initializer}}
diff --git a/test/Sema/compound-literal.c b/test/Sema/compound-literal.c
index f25d54f..5f31ae6 100644
--- a/test/Sema/compound-literal.c
+++ b/test/Sema/compound-literal.c
@@ -4,11 +4,11 @@
static struct foo t = (struct foo){0,0};
static struct foo t2 = {0,0};
-static struct foo t3 = t2; // -expected-error {{initializer element is not constant}}
+static struct foo t3 = t2; // -expected-error {{initializer element is not a compile-time constant}}
static int *p = (int []){2,4};
static int x = (int){1}; // -expected-warning{{braces around scalar initializer}}
-static int *p2 = (int []){2,x}; // -expected-error {{initializer element is not constant}}
+static int *p2 = (int []){2,x}; // -expected-error {{initializer element is not a compile-time constant}}
static int *p3 = (int []){2,"x"}; // -expected-warning {{incompatible pointer to integer conversion initializing 'char [2]', expected 'int'}}
typedef struct { } cache_t; // -expected-warning{{use of empty struct extension}}
diff --git a/test/Sema/cxx-class.cpp b/test/Sema/cxx-class.cpp
index b7702dd..1fbff69 100644
--- a/test/Sema/cxx-class.cpp
+++ b/test/Sema/cxx-class.cpp
@@ -34,7 +34,7 @@
int i = 0; // expected-error {{error: 'i' can only be initialized if it is a static const integral data member}}
static int si = 0; // expected-error {{error: 'si' can only be initialized if it is a static const integral data member}}
static const NestedC ci = 0; // expected-error {{error: 'ci' can only be initialized if it is a static const integral data member}}
- static const int nci = vs; // expected-error {{error: initializer element is not constant}}
+ static const int nci = vs; // expected-error {{error: initializer element is not a compile-time constant}}
static const int vi = 0;
static const E evi = 0;
diff --git a/test/Sema/init.c b/test/Sema/init.c
index efc934d..b57f046 100644
--- a/test/Sema/init.c
+++ b/test/Sema/init.c
@@ -38,7 +38,7 @@
short *a2(void)
{
short int b;
- static short *bp = &b; // expected-error {{initializer element is not constant}}
+ static short *bp = &b; // expected-error {{initializer element is not a compile-time constant}}
return bp;
}
diff --git a/test/Sema/static-init.c b/test/Sema/static-init.c
index 2439d5e..2f13800 100644
--- a/test/Sema/static-init.c
+++ b/test/Sema/static-init.c
@@ -1,7 +1,7 @@
// RUN: clang -fsyntax-only -verify %s
static int f = 10;
-static int b = f; // expected-error {{initializer element is not constant}}
+static int b = f; // expected-error {{initializer element is not a compile-time constant}}
-float r = (float) &r; // expected-error {{initializer element is not constant}}
+float r = (float) &r; // expected-error {{initializer element is not a compile-time constant}}
long long s = (long long) &s;
_Bool t = &t;
diff --git a/test/Sema/vla.c b/test/Sema/vla.c
index e8956fd..5f4857e 100644
--- a/test/Sema/vla.c
+++ b/test/Sema/vla.c
@@ -2,7 +2,7 @@
int test1() {
typedef int x[test1()]; // vla
- static int y = sizeof(x); // expected-error {{not constant}}
+ static int y = sizeof(x); // expected-error {{not a compile-time constant}}
}
// PR2347