diff options
| author | Alan Mackenzie | 2013-07-13 17:45:07 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2013-07-13 17:45:07 +0000 |
| commit | 2cdb769811731975a1ad65fd75d642f5b92b158a (patch) | |
| tree | 54f0d17b11b2372565e75d566c9c809514c783d4 | |
| parent | 922ae7eeed74d847778907602eb52e97cfb9f212 (diff) | |
| download | emacs-2cdb769811731975a1ad65fd75d642f5b92b158a.tar.gz emacs-2cdb769811731975a1ad65fd75d642f5b92b158a.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 32 |
2 files changed, 24 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1c01afd8576..91373ef8a6b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-07-13 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | * progmodes/cc-engine.el (c-forward-decl-or-cast-1): Label CASE 13 | ||
| 4 | and comment it out. This out-commenting enables certain C++ | ||
| 5 | declarations to be parsed correctly. | ||
| 6 | |||
| 1 | 2013-07-13 Eli Zaretskii <eliz@gnu.org> | 7 | 2013-07-13 Eli Zaretskii <eliz@gnu.org> |
| 2 | 8 | ||
| 3 | * international/mule.el (define-coding-system): Doc fix. | 9 | * international/mule.el (define-coding-system): Doc fix. |
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 9077bdbb513..65a3af3196e 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el | |||
| @@ -6892,7 +6892,7 @@ comment at the start of cc-engine.el for more info." | |||
| 6892 | (while (and (looking-at c-type-decl-prefix-key) | 6892 | (while (and (looking-at c-type-decl-prefix-key) |
| 6893 | (if (and (c-major-mode-is 'c++-mode) | 6893 | (if (and (c-major-mode-is 'c++-mode) |
| 6894 | (match-beginning 3)) | 6894 | (match-beginning 3)) |
| 6895 | ;; If the second submatch matches in C++ then | 6895 | ;; If the third submatch matches in C++ then |
| 6896 | ;; we're looking at an identifier that's a | 6896 | ;; we're looking at an identifier that's a |
| 6897 | ;; prefix only if it specifies a member pointer. | 6897 | ;; prefix only if it specifies a member pointer. |
| 6898 | (when (setq got-identifier (c-forward-name)) | 6898 | (when (setq got-identifier (c-forward-name)) |
| @@ -7193,19 +7193,23 @@ comment at the start of cc-engine.el for more info." | |||
| 7193 | ;; uncommon (e.g. some placements of "const" in C++) it's not worth | 7193 | ;; uncommon (e.g. some placements of "const" in C++) it's not worth |
| 7194 | ;; the effort to look for them.) | 7194 | ;; the effort to look for them.) |
| 7195 | 7195 | ||
| 7196 | (unless (or at-decl-end (looking-at "=[^=]")) | 7196 | ;;; 2008-04-16: commented out the next form, to allow the function to recognise |
| 7197 | ;; If this is a declaration it should end here or its initializer(*) | 7197 | ;;; "foo (int bar)" in CC (an implicit type (in class foo) without a semicolon) |
| 7198 | ;; should start here, so check for allowed separation tokens. Note | 7198 | ;;; as a(n almost complete) declaration, enabling it to be fontified. |
| 7199 | ;; that this rule doesn't work e.g. with a K&R arglist after a | 7199 | ;; CASE 13 |
| 7200 | ;; function header. | 7200 | ;; (unless (or at-decl-end (looking-at "=[^=]")) |
| 7201 | ;; | 7201 | ;; If this is a declaration it should end here or its initializer(*) |
| 7202 | ;; *) Don't check for C++ style initializers using parens | 7202 | ;; should start here, so check for allowed separation tokens. Note |
| 7203 | ;; since those already have been matched as suffixes. | 7203 | ;; that this rule doesn't work e.g. with a K&R arglist after a |
| 7204 | ;; | 7204 | ;; function header. |
| 7205 | ;; If `at-decl-or-cast' is then we've found some other sign that | 7205 | ;; |
| 7206 | ;; it's a declaration or cast, so then it's probably an | 7206 | ;; *) Don't check for C++ style initializers using parens |
| 7207 | ;; invalid/unfinished one. | 7207 | ;; since those already have been matched as suffixes. |
| 7208 | (throw 'at-decl-or-cast at-decl-or-cast)) | 7208 | ;; |
| 7209 | ;; If `at-decl-or-cast' is then we've found some other sign that | ||
| 7210 | ;; it's a declaration or cast, so then it's probably an | ||
| 7211 | ;; invalid/unfinished one. | ||
| 7212 | ;; (throw 'at-decl-or-cast at-decl-or-cast)) | ||
| 7209 | 7213 | ||
| 7210 | ;; Below are tests that only should be applied when we're certain to | 7214 | ;; Below are tests that only should be applied when we're certain to |
| 7211 | ;; not have parsed halfway through an expression. | 7215 | ;; not have parsed halfway through an expression. |