CLion 2021.2 Help

C++ keywords completion

CLion uses Clangd code snippets in C++ keywords completion. The snippets work similarly to live templates: when you start typing a keyword, you can select the snippet from the completion list and use Tab to move between stubs.

Find the full list of the currently available snippets on this Confluence page. A few examples are given below:

  • For the typedef keyword, completion suggests not only the keyword itself but also stubs for the type and the new name.

    Typedef completion

  • For namespace, CLion suggests several snippets that you can select from depending on the use case.

    Namespace completion

  • Also, there are sets of snippets for templates and C++ concepts. For example, here is how you can quickly define a new concept in your code:

    Completion for C++ Concepts

Last modified: 12 March 2021