Hello, In the case of C++ partial template specialization [1], functions are shown as variables. Please look at the attached screenshots. 1. emacs -Q 2. open attached C++ code "specialization.cc" attachments: - NG_cc-partial-specialization.png - OK_cc-partial-specialization.png - specialization.cc In cc-engine.el c-do-declarators, given CDD-NOT-TOP is non-nil at blow: ------------------------------------------------------------- (defun c-do-declarators (cdd-limit cdd-list cdd-not-top cdd-comma-prop cdd-function) [..snip..] (while (and (not cdd-exhausted) (setq cdd-decl-res (c-forward-declarator cdd-limit))) (setq cdd-next-pos (point) cdd-id-start (car cdd-decl-res) cdd-id-end (cadr cdd-decl-res) cdd-got-func (and (eq (char-after) ?\() (or (not (c-major-mode-is 'c++-mode)) (not cdd-not-top) <<<< nil if "class foo" (car (cddr (cddr cdd-decl-res))) ; Id is in ; parens, etc. (save-excursion (forward-char) (c-forward-syntactic-ws) (looking-at "[*&]"))) ------------------------------------------------------------- ------------------------------------------------------------- template<>> class One { public: One() {} // (not cdd-not-top): t private: char _c; }; template class Two { // "," in "class A<...>" public: Two() {} // (not cdd-not-top): nil private: T _t; char _c; }; ------------------------------------------------------------- After a brief investigation, the attached cc-engine.el patch seems to solve this issue at least, but it is not tested enough. attachments: - 0001-cc-mode-Fix-function-fontification-in-the-case-of-C-.patch [1] https://en.cppreference.com/w/cpp/language/partial_specialization ------------------------------------------------------------- $ g++ -o specialization specialization.cc $ ./specialization One: primary One: specialization Two: primary Two: specialization Two: specialization Two: specialization Two: specialization Two: specialization Two: specialization Two: specialization $ ------------------------------------------------------------- Regards, Naofumi