Skip to content

clang-format does not remove spaces in front of :: #150858

@nico

Description

@nico
% cat format.cc 
void f() {
  A::    B    ::C d;
}

Actual:

% out/gn/bin/clang-format format.cc
void f() { A::B ::C d; }

Expected:

void f() { A::B::C d; }

(i.e. no space after ::B)

I suppose clang-format isn't sure if ::C is a qualified global symbol or a continuation of a qualified name (?) Is there ever a situation where a globally-qualified identifier follows an identifier? (That heuristic would get it wrong after templates, but it'd still be a progression.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions