================
@@ -4569,6 +4569,19 @@ TEST_F(TokenAnnotatorTest, AttributeSquares) {
   EXPECT_TRUE(Tokens[15]->EndsCppAttributeGroup);
 }
 
+TEST_F(TokenAnnotatorTest, CSharpUtf8StringLiterals) {
+  const auto Style = getGoogleStyle(FormatStyle::LK_CSharp);
+  auto Tokens = annotate("var text = \"text/plain\"u8;", Style);
+
+  ASSERT_EQ(Tokens.size(), 6u) << Tokens;
+  EXPECT_TOKEN(Tokens[3], tok::utf8_string_literal, TT_CSharpStringLiteral);
+
+  Tokens = annotate("var text = $\"text/plain\"u8;", Style);
----------------
owenca wrote:

```suggestion
  Tokens = annotate("var text = @\"text/plain\"u8;", Style);
```
C# doesn't allow the `u8` suffix in string interpolation.

https://github.com/llvm/llvm-project/pull/211919
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to