]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* g++.old-deja/g++.other/string2.C: New test.
authorNathan Sidwell <nathan@codesourcery.com>
Wed, 8 Mar 2000 10:26:40 +0000 (10:26 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 8 Mar 2000 10:26:40 +0000 (10:26 +0000)
From-SVN: r32417

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/string2.C [new file with mode: 0644]

index 8ef05b42c0cb9ea943b7b712d74cc24d4e6a1e50..44dd18add2ee4952565afd6b0dcfcbdb2f3e23c5 100644 (file)
@@ -1,3 +1,7 @@
+2000-03-08  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * g++.old-deja/g++.other/string2.C: New test.
+
 2000-03-06  Nathan Sidwell  <nathan@codesourcery.com>
 
        * g++.old-deja/g++.warn/impint2.C: New test.    
diff --git a/gcc/testsuite/g++.old-deja/g++.other/string2.C b/gcc/testsuite/g++.old-deja/g++.other/string2.C
new file mode 100644 (file)
index 0000000..0442094
--- /dev/null
@@ -0,0 +1,17 @@
+// 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;
+}