New issue
Advanced search Search tips

Issue 691738 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

clang-format doesn't always include space after WARN_UNUSED_RESULT

Project Member Reported by eroman@chromium.org, Feb 13 2017

Issue description

If the type has leading :: then no space is included between the tokens.

As a contrived example:

// OK
WARN_UNUSED_RESULT std::string* Foo(int x) { 
   return nullptr;
}

// Expecting a space after WARN_UNUSED_RESULT
WARN_UNUSED_RESULT::std::string* Foo(int x) { 
   return nullptr;
}
 

Comment 1 by dcheng@chromium.org, Feb 13 2017

Filed https://bugs.llvm.org/show_bug.cgi?id=31951, but I'm not sure how easy this will be to fix. I guess it's not a very common issue to run into?

Comment 2 by eroman@chromium.org, Feb 13 2017

Yeah, probably not very common situation.

In the case of WARN_UNUSED_RESULT specifically, it is generally seen at the end of a function signature rather than the start.

And leading a leading "::" isn't that common outside of tests (in this case it came up on ::testing::AssertionResult).
Components: Tools

Sign in to add a comment