https://bugs.llvm.org/show_bug.cgi?id=52527
The follow patch ensures there is always a space between * and /* to prevent transforming
```
void foo(* /* comment */)(int bar);
```
into
```
void foo(*/* comment */)(int bar);
```
Differential Revision: https://reviews.llvm.org/D114142
};
if (Right.Tok.getIdentifierInfo() && Left.Tok.getIdentifierInfo())
return true; // Never ever merge two identifiers.
+
+ // Leave a space between * and /* to avoid C4138 `comment end` found outside
+ // of comment.
+ if (Left.is(tok::star) && Right.is(tok::comment))
+ return true;
+
if (Style.isCpp()) {
if (Left.is(tok::kw_operator))
return Right.is(tok::coloncolon);
verifyFormat("void f() { &(*I).first; }");
verifyIndependentOfContext("f(b * /* confusing comment */ ++c);");
+ verifyFormat("f(* /* confusing comment */ foo);");
+ verifyFormat("void (* /*deleter*/)(const Slice &key, void *value)");
+ verifyFormat("void foo(int * // this is the first paramters\n"
+ " ,\n"
+ " int second);");
+ verifyFormat("double term = a * // first\n"
+ " b;");
verifyFormat(
"int *MyValues = {\n"
" *A, // Operator detection might be confused by the '{'\n"