aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8.3/gcc/testsuite/g++.old-deja/g++.other/string2.C
blob: bf0699a1de63cf54139b0b6c46355549e4c0b2a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { dg-do run  }
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 6 Mar 2000 <nathan@codesourcery.com>

// A char const array should never be confused for a string literal.

int main ()
{
  static const char ary[] = "wibble";
  void const *ptr = 0;
  
  ptr = ary;
  if (ptr == "wibble")
    return 1;
  if (ptr != ary)
    return 1;
  return 0;
}