Skip to content

Commit 0b37f90

Browse files
doublepruediger
authored andcommitted
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 <[email protected]> and updated by Rüdiger Sonderfeld <[email protected]>.
1 parent 1901029 commit 0b37f90

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

lisp/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2014-11-18 Paul Pogonyshev <[email protected]>
2+
Rüdiger Sonderfeld <[email protected]>
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+
112
2014-11-17 Michal Nazarewicz <[email protected]>
213

314
* textmodes/tildify.el (tildify-pattern, tildify-space-string):

lisp/progmodes/cc-langs.el

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,8 @@ since CC Mode treats every identifier as an expression."
970970
,@(when (c-major-mode-is 'c++-mode)
971971
;; The following need special treatment.
972972
`((prefix "dynamic_cast" "static_cast"
973-
"reinterpret_cast" "const_cast" "typeid")))
973+
"reinterpret_cast" "const_cast" "typeid"
974+
"alignof")))
974975
(left-assoc "."
975976
,@(unless (c-major-mode-is 'java-mode)
976977
'("->")))
@@ -1648,7 +1649,7 @@ the appropriate place for that."
16481649
'("_Bool" "_Complex" "_Imaginary") ; Conditionally defined in C99.
16491650
(c-lang-const c-primitive-type-kwds))
16501651
c++ (append
1651-
'("bool" "wchar_t")
1652+
'("bool" "wchar_t" "char16_t" "char32_t")
16521653
(c-lang-const c-primitive-type-kwds))
16531654
;; Objective-C extends C, but probably not the new stuff in C99.
16541655
objc (append
@@ -1730,7 +1731,7 @@ but they don't build a type of themselves. Unlike the keywords on
17301731
not the type face."
17311732
t nil
17321733
c '("const" "restrict" "volatile")
1733-
c++ '("const" "volatile" "throw")
1734+
c++ '("const" "constexpr" "noexcept" "volatile" "throw")
17341735
objc '("const" "volatile"))
17351736

17361737
(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',
19321933
will be handled."
19331934
t nil
19341935
(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")
19361938
(c-lang-const c-modifier-kwds))
19371939
objc '("auto" "bycopy" "byref" "extern" "in" "inout" "oneway" "out" "static")
19381940
;; FIXME: Some of those below ought to be on `c-other-decl-kwds' instead.
@@ -2384,8 +2386,11 @@ This construct is \"<keyword> <expression> :\"."
23842386
(c-lang-defconst c-constant-kwds
23852387
"Keywords for constants."
23862388
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.
23882390
"false" "true") ; Defined in C99.
2391+
c++ (append
2392+
'("nullptr")
2393+
(c-lang-const c-constant-kwds))
23892394
objc '("nil" "Nil" "YES" "NO" "NS_DURING" "NS_HANDLER" "NS_ENDHANDLER")
23902395
idl '("TRUE" "FALSE")
23912396
java '("true" "false" "null") ; technically "literals", not keywords

0 commit comments

Comments
 (0)