* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Add rule for template.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Add test.
(cherry picked from commit
cb421286d2e9834d90d29288c932a6c6e03a555f)
,@(when (eq mode 'cpp)
'(((node-is "access_specifier") parent-bol 0)
;; Indent the body of namespace definitions.
- ((parent-is "declaration_list") parent-bol c-ts-mode-indent-offset)))
+ ((parent-is "declaration_list") parent-bol c-ts-mode-indent-offset)
+ ((parent-is "template_declaration") parent-bol 0)))
;; int[5] a = { 0, 0, 0, 0 };
}
=-=-=
+Name: Namespace and template (bug#72263)
+
+=-=
+namespace A {
+
+T myfunction1(const char *fname)
+{
+}
+
+template <class T>
+T myfunction2(const char *fname)
+{
+}
+}
+=-=
+namespace A {
+
+ T myfunction1(const char *fname)
+ {
+ }
+
+ template <class T>
+ T myfunction2(const char *fname)
+ {
+ }
+}
+=-=-=
+
Code:
(lambda ()
(c-ts-mode)