-
Notifications
You must be signed in to change notification settings - Fork 15k
Open
Open
Copy link
Labels
Description
Here's a regression test demonstrating this:
// RUN: grep -Ev "// *[A-Z-]+" %s | clang-format --style='{BasedOnStyle: google, ColumnLimit: 0}' | FileCheck %s -strict-whitespace
// CHECK: ::test_anonymous::FunctionApplication& ::test_anonymous::FunctionApplication::operator=(const ::test_anonymous::FunctionApplication& other) noexcept {
::test_anonymous::FunctionApplication& ::test_anonymous::FunctionApplication::operator=(const ::test_anonymous::FunctionApplication& other) noexcept {
storage_ = other.CloneStorage_();
return *this;
}
which fails with
# | /usr/local/google/home/leonardchan/llvm-projects/llvm-project-1/clang/test/Format/regression-test.cpp:3:11: error: CHECK: expected string not found in input
# | // CHECK: ::test_anonymous::FunctionApplication& ::test_anonymous::FunctionApplication::operator=(const ::test_anonymous::FunctionApplication& other) noexcept {
# | ^
# | <stdin>:1:1: note: scanning from here
# |
# | ^
# | <stdin>:2:1: note: possible intended match here
# | ::test_anonymous::FunctionApplication& ::test_anonymous::FunctionApplication::operator=(const ::test_anonymous::FunctionApplication & other) noexcept {
# | ^
# |
The google style guide does not permit a space before the & as per https://google.github.io/styleguide/cppguide.html#Pointer_and_Reference_Expressions.