1 // PR c++/65642 2 // { dg-do compile { target c++11 } } 3 4 #define SA(X) static_assert((X),#X) 5 6 constexpr char s[] = "abc"; 7 8 constexpr bool cmp(char const * a,char const * b)9cmp (char const *a, char const *b) 10 { 11 return a == b; 12 } 13 14 constexpr bool fn1(const char * s)15fn1 (const char *s) 16 { 17 return cmp (s, s + 1); 18 } 19 20 constexpr bool fn2(const char * s)21fn2 (const char *s) 22 { 23 return cmp (s + 1, s + 1); 24 } 25 26 constexpr auto c1 = fn1 (&s[0]); 27 constexpr auto c2 = fn2 (&s[0]); 28 29 SA (!c1); 30 SA (c2); 31