Skip to content

clang-format formats template template parameters inconsistently for Mozilla/Chromium style #48746

Closed
@zetafunction

Description

@zetafunction
Bugzilla Link 49402
Version 11.0
OS All

Extended Description

Input:

  $ cat test.cc 
  template <template <typename> class A,
            template <typename> class B,
            typename C,
            typename D>
  struct TemplatedClass {};

Output for Mozilla style:

  $ clang-format --style=Mozilla test.cc
  template<template<typename> class A,
           template<typename>
           class B,
           typename C,
           typename D>
  struct TemplatedClass
  {};

Output for Chromium style:

  $ clang-format --style=Chromium test.cc
  template <template <typename> class A,
            template <typename>
            class B,
            typename C,
            typename D>
  struct TemplatedClass {};

One might have expected "template " and "class B" to be on the same line, as is the case with the first template template parameter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorbugzillaIssues migrated from bugzillaclang-format

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions