From: Michael Shields <shields@msrl.com>
To: 13871@debbugs.gnu.org
Subject: bug#13871: Add new C++11 keywords to c++-mode
Date: Mon, 4 Mar 2013 17:26:00 -0800 [thread overview]
Message-ID: <CALvMCHLwo+Gutw-RAtYmG0yrUKyEPp60EtXxDkGPSXR=8JHRcQ@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 318 bytes --]
This small patch adds c++-mode support for new C++11 keywords.
My employer, Google, has a copyright assignment on file.
2013-03-04 Michael Shields <shields@msrl.com>
* lisp/progmodes/cc-langs.el: Add support for new C++11 keywords
"alignas", "alignof", "constexpr", "decltype", "nullptr", and
"thread_local".
[-- Attachment #2: c++11.diff --]
[-- Type: application/octet-stream, Size: 1922 bytes --]
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 0d5549e..a50152f 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -973,7 +973,8 @@ since CC Mode treats every identifier as an expression."
;; Unary.
(prefix "++" "--" "+" "-" "!" "~"
- ,@(when (c-major-mode-is 'c++-mode) '("not" "compl"))
+ ,@(when (c-major-mode-is 'c++-mode)
+ '("not" "compl" "alignas" "alignof" "decltype"))
,@(when (c-major-mode-is '(c-mode c++-mode))
'("*" "&" "sizeof" "??-"))
,@(when (c-major-mode-is 'objc-mode)
@@ -1676,7 +1677,7 @@ but they don't build a type of themselves. Unlike the keywords on
not the type face."
t nil
c '("const" "restrict" "volatile")
- c++ '("const" "volatile" "throw")
+ c++ '("const" "constexpr" "throw" "volatile")
objc '("const" "volatile"))
(c-lang-defconst c-opt-type-modifier-key
@@ -1857,7 +1858,8 @@ If any of these also are on `c-type-list-kwds', `c-ref-list-kwds',
will be handled."
t nil
(c c++) '("auto" "extern" "inline" "register" "static")
- c++ (append '("explicit" "friend" "mutable" "template" "using" "virtual")
+ c++ (append '("explicit" "friend" "mutable" "template" "thread_local" "using"
+ "virtual")
(c-lang-const c-modifier-kwds))
objc '("auto" "bycopy" "byref" "extern" "in" "inout" "oneway" "out" "static")
;; FIXME: Some of those below ought to be on `c-other-decl-kwds' instead.
@@ -2293,6 +2295,7 @@ This construct is \"<keyword> <expression> :\"."
t nil
(c c++) '("NULL" ;; Not a keyword, but practically works as one.
"false" "true") ; Defined in C99.
+ c++ '("NULL" "nullptr" "false" "true")
objc '("nil" "Nil" "YES" "NO" "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER")
idl '("TRUE" "FALSE")
java '("true" "false" "null") ; technically "literals", not keywords
next reply other threads:[~2013-03-05 1:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-05 1:26 Michael Shields [this message]
2014-11-18 16:48 ` bug#13871: Add new C++11 keywords to c++-mode Rüdiger Sonderfeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALvMCHLwo+Gutw-RAtYmG0yrUKyEPp60EtXxDkGPSXR=8JHRcQ@mail.gmail.com' \
--to=shields@msrl.com \
--cc=13871@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.