This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib: Fix C++ named operators bug
Jason Merrill wrote:-
> It does. However, they were handled in the frontend, so your testcase
> wouldn't have worked.
Ah, OK. The testcase is actually bogus; it passes only because #if
is ignored with -fpreprocessed. Silly me. It needs to be a do-compile
test, and put in g++.dg/parse. Is that OK with you?
I guess I should backport something to 3.1 (are we going to release
a final 3.0.5 or not? If not I won't bother there).
Neil.
testsuite:
* gcc.dg/cpp/testsuite/named_ops.c: Remove.
* g++.dg/parse/named_ops.C: New test.
Index: gcc.dg/cpp/named_ops.c
===================================================================
RCS file: gcc.dg/cpp/named_ops.c
diff -N gcc.dg/cpp/named_ops.c
--- gcc.dg/cpp/named_ops.c 23 May 2002 18:55:27 -0000 1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-/* Copyright (C) 2002 Free Software Foundation, Inc. */
-
-/* { dg-do preprocess } */
-/* { dg-options -fpreprocessed } */
-
-/* Tests that C++ named ops are still there with -fpreprocessed. */
-
-/* Source: Neil Booth, 23 May 2002. */
-
-#if 2 xor 2
-#endif
Index: g++.dg/parse/named_ops.C
===================================================================
RCS file: g++.dg/parse/named_ops.C
diff -N g++.dg/parse/named_ops.C
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ g++.dg/parse/named_ops.C 23 May 2002 19:28:34 -0000
@@ -0,0 +1,13 @@
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options -fpreprocessed } */
+
+/* Tests that C++ named ops are still there with -fpreprocessed. */
+
+/* Source: Neil Booth, 23 May 2002. */
+
+int main ()
+{
+ return 2 xor 2;
+}