aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2018-08-16 19:18:42 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2018-08-16 19:18:42 +0000
commit729a01f72ca6c1bd106cb2285187191c3568201b (patch)
tree8cba46feaa371a76edad8a772eeab6d7071b0b7d /gcc/testsuite/gcc.dg/cpp
parentc37da7c0e8d022f4ad85bd0adf7f80886df9c94e (diff)
downloadgcc-729a01f72ca6c1bd106cb2285187191c3568201b.zip
gcc-729a01f72ca6c1bd106cb2285187191c3568201b.tar.gz
gcc-729a01f72ca6c1bd106cb2285187191c3568201b.tar.bz2
[PATCH] Macro definition parameter parsing
https://gcc.gnu.org/ml/gcc-patches/2018-08/msg00977.html libcpp/ * internal.h (_cpp_save_parameter): Take parmno, not macro. (_cpp_unsave_parameters): Declare. * macro.c (_cpp_save_parameter): Take parm number, not macro. Return true on success. (_cpp_unsave_parameters): New. (parse_params): Take parm_no and variadic pointers, not macro. Reimplement parsing logic. (create_iso_definition): Adjust parse_params changes. Call _cpp_unsave_parameters here. (_cpp_create_definition): Don't unsave params here. * traditional.c (scan_parameters): Take n_param pointer, adjust. (_cpp_create_trad_definition): Ajust scan_parameters change. Call _cpp_unsave_parameters. gcc/testsuite/ * gcc.dg/cpp/macsyntx.c: Adjust expected errors. * gcc.dg/cpp/macsyntx2.c: likewise. From-SVN: r263600
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/macsyntx.c8
-rw-r--r--gcc/testsuite/gcc.dg/cpp/macsyntx2.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/macsyntx.c b/gcc/testsuite/gcc.dg/cpp/macsyntx.c
index a6c8e11..dab1e9d 100644
--- a/gcc/testsuite/gcc.dg/cpp/macsyntx.c
+++ b/gcc/testsuite/gcc.dg/cpp/macsyntx.c
@@ -21,14 +21,14 @@
#define ; /* { dg-error "identifier" } */
#define SEMI; /* { dg-warning "space" } */
-#define foo(X /* { dg-error "missing" } */
+#define foo(X /* { dg-error "expected" } */
#define foo\
(X,) /* { dg-error "parameter name" } */
#define foo(, X) /* { dg-error "parameter name" } */
#define foo(X, X) /* { dg-error "duplicate" } */
-#define foo(X Y) /* { dg-error "comma" } */
-#define foo(() /* { dg-error "may not appear" } */
-#define foo(..., X) /* { dg-error "missing" } */
+#define foo(X Y) /* { dg-error "expected" } */
+#define foo(() /* { dg-error "parameter name" } */
+#define foo(..., X) /* { dg-error "expected" } */
#define foo \
__VA_ARGS__ /* { dg-warning "__VA_ARGS__" } */
#define goo(__VA_ARGS__) /* { dg-warning "__VA_ARGS__" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/macsyntx2.c b/gcc/testsuite/gcc.dg/cpp/macsyntx2.c
index 1fbd115..f0fcf52 100644
--- a/gcc/testsuite/gcc.dg/cpp/macsyntx2.c
+++ b/gcc/testsuite/gcc.dg/cpp/macsyntx2.c
@@ -21,14 +21,14 @@
#define ; /* { dg-error "identifier" } */
#define SEMI; /* { dg-warning "space" } */
-#define foo(X /* { dg-error "missing" } */
+#define foo(X /* { dg-error "expected" } */
#define foo\
(X,) /* { dg-error "parameter name" } */
#define foo(, X) /* { dg-error "parameter name" } */
#define foo(X, X) /* { dg-error "duplicate" } */
-#define foo(X Y) /* { dg-error "comma" } */
-#define foo(() /* { dg-error "may not appear" } */
-#define foo(..., X) /* { dg-error "missing" } */
+#define foo(X Y) /* { dg-error "expected" } */
+#define foo(() /* { dg-error "parameter name" } */
+#define foo(..., X) /* { dg-error "expected" } */
#define foo \
__VA_ARGS__ /* { dg-warning "__VA_ARGS__" } */
#define goo(__VA_ARGS__) /* { dg-warning "__VA_ARGS__" } */