diff options
| author | Paul Pogonyshev | 2014-11-18 03:34:01 +0100 |
|---|---|---|
| committer | Rüdiger Sonderfeld | 2014-11-18 03:34:01 +0100 |
| commit | 0b37f903b62b29726644dbad330d2a0bf91d85d6 (patch) | |
| tree | f5bb3c8c11230df191853579bd64f88fdb853552 | |
| parent | 1901029f6b6aadd210001b2154282bec0b9d3b07 (diff) | |
| download | emacs-0b37f903b62b29726644dbad330d2a0bf91d85d6.tar.gz emacs-0b37f903b62b29726644dbad330d2a0bf91d85d6.zip | |
progmodes/cc-langs.el: Support some of the new keywords in C++11.
(c-operators): Add "alignof".
(c-primitive-type-kwds): Add "char16_t", "char32_t".
(c-type-modifier-kwds): Add "constexpr", "noexcept".
(c-modifier-kwds): Add "thread_local".
(c-constant-kwds): Add "nullptr".
Original patch by Paul Pogonyshev <pogonyshev@gmail.com> and updated
by Rüdiger Sonderfeld <ruediger@c-plusplus.net>.
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/progmodes/cc-langs.el | 15 |
2 files changed, 21 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0075c5a79ca..968ea8df0ef 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2014-11-18 Paul Pogonyshev <pogonyshev@gmail.com> | ||
| 2 | Rüdiger Sonderfeld <ruediger@c-plusplus.net> | ||
| 3 | |||
| 4 | * progmodes/cc-langs.el: Support some of the new keywords in | ||
| 5 | C++11. | ||
| 6 | (c-operators): Add "alignof". | ||
| 7 | (c-primitive-type-kwds): Add "char16_t", "char32_t". | ||
| 8 | (c-type-modifier-kwds): Add "constexpr", "noexcept". | ||
| 9 | (c-modifier-kwds): Add "thread_local". | ||
| 10 | (c-constant-kwds): Add "nullptr". | ||
| 11 | |||
| 1 | 2014-11-17 Michal Nazarewicz <mina86@mina86.com> | 12 | 2014-11-17 Michal Nazarewicz <mina86@mina86.com> |
| 2 | 13 | ||
| 3 | * textmodes/tildify.el (tildify-pattern, tildify-space-string): | 14 | * textmodes/tildify.el (tildify-pattern, tildify-space-string): |
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el index 2a5db6d3c86..68b2d6232c0 100644 --- a/lisp/progmodes/cc-langs.el +++ b/lisp/progmodes/cc-langs.el | |||
| @@ -970,7 +970,8 @@ since CC Mode treats every identifier as an expression." | |||
| 970 | ,@(when (c-major-mode-is 'c++-mode) | 970 | ,@(when (c-major-mode-is 'c++-mode) |
| 971 | ;; The following need special treatment. | 971 | ;; The following need special treatment. |
| 972 | `((prefix "dynamic_cast" "static_cast" | 972 | `((prefix "dynamic_cast" "static_cast" |
| 973 | "reinterpret_cast" "const_cast" "typeid"))) | 973 | "reinterpret_cast" "const_cast" "typeid" |
| 974 | "alignof"))) | ||
| 974 | (left-assoc "." | 975 | (left-assoc "." |
| 975 | ,@(unless (c-major-mode-is 'java-mode) | 976 | ,@(unless (c-major-mode-is 'java-mode) |
| 976 | '("->"))) | 977 | '("->"))) |
| @@ -1648,7 +1649,7 @@ the appropriate place for that." | |||
| 1648 | '("_Bool" "_Complex" "_Imaginary") ; Conditionally defined in C99. | 1649 | '("_Bool" "_Complex" "_Imaginary") ; Conditionally defined in C99. |
| 1649 | (c-lang-const c-primitive-type-kwds)) | 1650 | (c-lang-const c-primitive-type-kwds)) |
| 1650 | c++ (append | 1651 | c++ (append |
| 1651 | '("bool" "wchar_t") | 1652 | '("bool" "wchar_t" "char16_t" "char32_t") |
| 1652 | (c-lang-const c-primitive-type-kwds)) | 1653 | (c-lang-const c-primitive-type-kwds)) |
| 1653 | ;; Objective-C extends C, but probably not the new stuff in C99. | 1654 | ;; Objective-C extends C, but probably not the new stuff in C99. |
| 1654 | objc (append | 1655 | objc (append |
| @@ -1730,7 +1731,7 @@ but they don't build a type of themselves. Unlike the keywords on | |||
| 1730 | not the type face." | 1731 | not the type face." |
| 1731 | t nil | 1732 | t nil |
| 1732 | c '("const" "restrict" "volatile") | 1733 | c '("const" "restrict" "volatile") |
| 1733 | c++ '("const" "volatile" "throw") | 1734 | c++ '("const" "constexpr" "noexcept" "volatile" "throw") |
| 1734 | objc '("const" "volatile")) | 1735 | objc '("const" "volatile")) |
| 1735 | 1736 | ||
| 1736 | (c-lang-defconst c-opt-type-modifier-key | 1737 | (c-lang-defconst c-opt-type-modifier-key |
| @@ -1932,7 +1933,8 @@ If any of these also are on `c-type-list-kwds', `c-ref-list-kwds', | |||
| 1932 | will be handled." | 1933 | will be handled." |
| 1933 | t nil | 1934 | t nil |
| 1934 | (c c++) '("auto" "extern" "inline" "register" "static") | 1935 | (c c++) '("auto" "extern" "inline" "register" "static") |
| 1935 | c++ (append '("explicit" "friend" "mutable" "template" "using" "virtual") | 1936 | c++ (append '("explicit" "friend" "mutable" "template" "thread_local" |
| 1937 | "using" "virtual") | ||
| 1936 | (c-lang-const c-modifier-kwds)) | 1938 | (c-lang-const c-modifier-kwds)) |
| 1937 | objc '("auto" "bycopy" "byref" "extern" "in" "inout" "oneway" "out" "static") | 1939 | objc '("auto" "bycopy" "byref" "extern" "in" "inout" "oneway" "out" "static") |
| 1938 | ;; FIXME: Some of those below ought to be on `c-other-decl-kwds' instead. | 1940 | ;; FIXME: Some of those below ought to be on `c-other-decl-kwds' instead. |
| @@ -2384,8 +2386,11 @@ This construct is \"<keyword> <expression> :\"." | |||
| 2384 | (c-lang-defconst c-constant-kwds | 2386 | (c-lang-defconst c-constant-kwds |
| 2385 | "Keywords for constants." | 2387 | "Keywords for constants." |
| 2386 | t nil | 2388 | t nil |
| 2387 | (c c++) '("NULL" ;; Not a keyword, but practically works as one. | 2389 | c '("NULL" ;; Not a keyword, but practically works as one. |
| 2388 | "false" "true") ; Defined in C99. | 2390 | "false" "true") ; Defined in C99. |
| 2391 | c++ (append | ||
| 2392 | '("nullptr") | ||
| 2393 | (c-lang-const c-constant-kwds)) | ||
| 2389 | objc '("nil" "Nil" "YES" "NO" "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER") | 2394 | objc '("nil" "Nil" "YES" "NO" "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER") |
| 2390 | idl '("TRUE" "FALSE") | 2395 | idl '("TRUE" "FALSE") |
| 2391 | java '("true" "false" "null") ; technically "literals", not keywords | 2396 | java '("true" "false" "null") ; technically "literals", not keywords |