I'm using flycheck in cc-mode and it reminds me when I'm typing:

member reference type 'ListNode *' is a pointer; did you mean to use '->'?

I want to know if there's any package can convert . into -> automatically when typing in C/C++ code, just like Qt Creator's default behavior?

1 Answer 1


Not completely automatic, but flycheck-ycmd supports that because it uses Clang under the hood and Clang's fix-its are available from Emacs.

Position the point under the variable, just do M-x ycmd-fixit and accept the proposed fix-it.

You can disable the prompt before applying a fix-it by eval'ing

(setq ycmd-confirm-fixit nil)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.