aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestCSharp.cpp
diff options
context:
space:
mode:
authorOwen Pan <owenpiano@gmail.com>2025-04-25 13:08:16 -0700
committerGitHub <noreply@github.com>2025-04-25 13:08:16 -0700
commit61d78d0c089d0e2bff994c5b3c353d22d4d8c1c7 (patch)
tree4078458ac3d3e558a4ffb6215d5c7789dfa0f647 /clang/unittests/Format/FormatTestCSharp.cpp
parent5c197236ed7eea010a4697706e2472145a7c0c61 (diff)
downloadllvm-61d78d0c089d0e2bff994c5b3c353d22d4d8c1c7.zip
llvm-61d78d0c089d0e2bff994c5b3c353d22d4d8c1c7.tar.gz
llvm-61d78d0c089d0e2bff994c5b3c353d22d4d8c1c7.tar.bz2
[clang-format] Correctly handle C# where clause (#137295)
Fix #74947
Diffstat (limited to 'clang/unittests/Format/FormatTestCSharp.cpp')
-rw-r--r--clang/unittests/Format/FormatTestCSharp.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestCSharp.cpp b/clang/unittests/Format/FormatTestCSharp.cpp
index 151f707..dae362c 100644
--- a/clang/unittests/Format/FormatTestCSharp.cpp
+++ b/clang/unittests/Format/FormatTestCSharp.cpp
@@ -1315,6 +1315,12 @@ TEST_F(FormatTestCSharp, CSharpGenericTypeConstraints) {
"}",
Style);
+ verifyFormat("namespace A {\n"
+ " delegate T MyDelegate<T>()\n"
+ " where T : new();\n"
+ "}",
+ Style);
+
// When the "where" line is not to be formatted, following lines should not
// take on its indentation.
verifyFormat("class ItemFactory<T>\n"