This fixes bug #52157.
* lisp/progmodes/cc-engine.el (c-forward-decl-or-cast-1): If such a construct
is parsed, set the flag at-type-decl which is part of the function's return
value.
(save-excursion
(goto-char type-start)
(let ((c-promote-possible-types t))
- (c-forward-type)))))
+ (c-forward-type))))
+
+ ;; Signal a type declaration for "struct foo {".
+ (when (and backup-at-type-decl
+ (eq (char-after) ?{))
+ (setq at-type-decl t)))
(setq backup-at-type at-type
backup-type-start type-start