Subject: bug#36484: c-mode hangs on macro with comment

From: Nicholas Drozd <[email-masked]>
Date: Thu, 4 Jul 2019 12:08:14 -0500

Works for me! Attached is a patch for an added cc-mode test case.

By the way, I came across this issue because a similar line appears in
a winning entry to the 1988 International Obfuscated C Code Contest
(https://www.ioccc.org/1988/dale.c). That line is included in the test
case.

Trivia question: which Emacs maintainer is a past IOCCC winner?
From 569c10a367edb261a45d41f119d98e3bc932d135 Mon Sep 17 00:00:00 2001
From: Nick Drozd <[email-masked]>
Date: Thu, 4 Jul 2019 10:59:25 -0500
Subject: [PATCH] * test/lisp/progmodes/cc-mode-tests.el: Add test for
 bug#36484

---
 test/lisp/progmodes/cc-mode-tests.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/lisp/progmodes/cc-mode-tests.el b/test/lisp/progmodes/cc-mode-tests.el
index 0b8f37dbbf..c10105fffc 100644
--- a/test/lisp/progmodes/cc-mode-tests.el
+++ b/test/lisp/progmodes/cc-mode-tests.el
@@ -69,4 +69,13 @@ c-or-c++-mode
               "struct template {"
               "#include <string.h>")))))
 
+(ert-deftest c-mode-macro-comment ()
+  "Test for bug#36484."
+  (dolist (macro-string '("#define /***/f"
+                          "#define x /***/5"
+                          "#define a(x)get/***/x/***/id())"))
+    (with-temp-buffer
+      (insert macro-string)
+      (c-mode))))
+
 ;;; cc-mode-tests.el ends here
-- 
2.17.1