2 // { dg-do compile { target c++14 } }
4 int fn1 (void) { return 0; }
5 int fn2 (void) { return 1; }
10 char a[] = { 1, 2, 3, 4 };
15 if (&a[1] == &"foo"[4])
18 if (&"foo"[1] == &a[0])
21 if (&"foo"[3] == &a[4])
27 // Pointer to start of one object (var) and end of another one (literal)
28 if (&a[0] == &"foo"[4]) // { dg-error "is not a constant expression" }
37 char a[] = { 1, 2, 3, 4 };
39 // Pointer to end of one object (var) and start of another one (literal)
40 if (&a[4] == "foo") // { dg-error "is not a constant expression" }
46 char v[] = { 1, 2, 3, 4 };
51 char a[] = { 1, 2, 3, 4 };
62 // Pointer to start of one object (automatic var) and end of another one (non-automagic var)
63 if (&a[0] == &v[4]) // { dg-error "is not a constant expression" }
72 char a[] = { 1, 2, 3, 4, 5 };
74 // Pointer to end of one object (automatic var) and start of another one (non-automagic var)
75 if (&a[5] == &v[0]) // { dg-error "is not a constant expression" }
90 if (&"abcde"[0] == &"edcba"[1])
93 if (&"abcde"[1] == &"edcba"[6])
96 // Pointer to start of one object (literal) and end of another one (literal)
97 if (&"abcde"[0] == &"edcba"[6]) // { dg-error "is not a constant expression" }
106 // Pointer to start of one object (literal) and end of another one (literal)
107 if (&"abcde"[6] == &"edcba"[0]) // { dg-error "is not a constant expression" }
116 if (&"abcde"[3] == &"fabcde"[3])
119 // These could be suffix merged, with &"abcde"[0] == &"fabcde"[1].
120 if (&"abcde"[3] == &"fabcde"[4]) // { dg-error "is not a constant expression" }
126 constexpr bool a = f1 ();
127 constexpr bool b = f2 ();
128 constexpr bool c = f3 ();
129 constexpr bool d = f4 ();
130 constexpr bool e = f5 ();
131 constexpr bool f = f6 ();
132 constexpr bool g = f7 ();