]> git.eshelyaron.com Git - emacs.git/commitdiff
progmodes/cc-engine.el (c-forward-decl-or-cast-1): Label CASE 13
authorAlan Mackenzie <acm@muc.de>
Sat, 13 Jul 2013 17:45:07 +0000 (17:45 +0000)
committerAlan Mackenzie <acm@muc.de>
Sat, 13 Jul 2013 17:45:07 +0000 (17:45 +0000)
and comment it out.  This out-commenting enables certain C++
declarations to be parsed correctly.

lisp/ChangeLog
lisp/progmodes/cc-engine.el

index 1c01afd8576cdb9f9d293aa85143aabce7359673..91373ef8a6b38dc485228b2dd28ef4881db0f332 100644 (file)
@@ -1,3 +1,9 @@
+2013-07-13  Alan Mackenzie  <acm@muc.de>
+
+       * progmodes/cc-engine.el (c-forward-decl-or-cast-1): Label CASE 13
+       and comment it out.  This out-commenting enables certain C++
+       declarations to be parsed correctly.
+
 2013-07-13  Eli Zaretskii  <eliz@gnu.org>
 
        * international/mule.el (define-coding-system): Doc fix.
index 9077bdbb51399fa341649ed52ab8dee349f4bdbd..65a3af3196e020e06e6dd5a2885d3d3eb8289d9e 100644 (file)
@@ -6892,7 +6892,7 @@ comment at the start of cc-engine.el for more info."
       (while (and (looking-at c-type-decl-prefix-key)
                  (if (and (c-major-mode-is 'c++-mode)
                           (match-beginning 3))
-                     ;; If the second submatch matches in C++ then
+                     ;; If the third submatch matches in C++ then
                      ;; we're looking at an identifier that's a
                      ;; prefix only if it specifies a member pointer.
                      (when (setq got-identifier (c-forward-name))
@@ -7193,19 +7193,23 @@ comment at the start of cc-engine.el for more info."
        ;; uncommon (e.g. some placements of "const" in C++) it's not worth
        ;; the effort to look for them.)
 
-       (unless (or at-decl-end (looking-at "=[^=]"))
-         ;; If this is a declaration it should end here or its initializer(*)
-         ;; should start here, so check for allowed separation tokens.  Note
-         ;; that this rule doesn't work e.g. with a K&R arglist after a
-         ;; function header.
-         ;;
-         ;; *) Don't check for C++ style initializers using parens
-         ;; since those already have been matched as suffixes.
-         ;;
-         ;; If `at-decl-or-cast' is then we've found some other sign that
-         ;; it's a declaration or cast, so then it's probably an
-         ;; invalid/unfinished one.
-         (throw 'at-decl-or-cast at-decl-or-cast))
+;;; 2008-04-16: commented out the next form, to allow the function to recognise
+;;; "foo (int bar)" in CC (an implicit type (in class foo) without a semicolon)
+;;; as a(n almost complete) declaration, enabling it to be fontified.
+       ;; CASE 13
+       ;; (unless (or at-decl-end (looking-at "=[^=]"))
+       ;; If this is a declaration it should end here or its initializer(*)
+       ;; should start here, so check for allowed separation tokens.  Note
+       ;; that this rule doesn't work e.g. with a K&R arglist after a
+       ;; function header.
+       ;;
+       ;; *) Don't check for C++ style initializers using parens
+       ;; since those already have been matched as suffixes.
+       ;;
+       ;; If `at-decl-or-cast' is then we've found some other sign that
+       ;; it's a declaration or cast, so then it's probably an
+       ;; invalid/unfinished one.
+       ;;  (throw 'at-decl-or-cast at-decl-or-cast))
 
        ;; Below are tests that only should be applied when we're certain to
        ;; not have parsed halfway through an expression.