Fix bug (and add test) for a function-like-macro appearing as a non-macro.
authorCarl Worth <cworth@cworth.org>
Mon, 17 May 2010 17:34:29 +0000 (10:34 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 17 May 2010 17:34:29 +0000 (10:34 -0700)
That is, when a function-like macro appears in the content without
parentheses it should be accepted and passed on through, (previously
the parser was regarding this as a syntax error).

glcpp-parse.y
tests/025-func-macro-as-non-macro.c [new file with mode: 0644]

index 16d2a28a007ccf5669868749df670722071e598d..6f158d91398beb4200f45af962d0706ec5df0c2b 100644 (file)
@@ -133,6 +133,10 @@ content:
                printf ("%s", $1);
                talloc_free ($1);
        }
+|      FUNC_MACRO {
+               printf ("%s", $1);
+               talloc_free ($1);
+       }
 |      macro {
                _print_string_list ($1);
        }
diff --git a/tests/025-func-macro-as-non-macro.c b/tests/025-func-macro-as-non-macro.c
new file mode 100644 (file)
index 0000000..3dbe026
--- /dev/null
@@ -0,0 +1,2 @@
+#define foo(bar) bar
+foo