[clang] [clang-format] Handle template closer followed by braces (PR #110971)

Carlos Galvez via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 3 22:25:29 PDT 2024


================
@@ -3538,6 +3538,11 @@ TEST_F(TokenAnnotatorTest, TemplateInstantiation) {
   ASSERT_EQ(Tokens.size(), 11u) << Tokens;
   EXPECT_TOKEN(Tokens[2], tok::less, TT_TemplateOpener);
   EXPECT_TOKEN(Tokens[6], tok::greater, TT_TemplateCloser);
+
+  Tokens = annotate("return std::conditional_t<T::value == U::value, T, U>{};");
+  ASSERT_EQ(Tokens.size(), 21u) << Tokens;
+  EXPECT_TOKEN(Tokens[4], tok::less, TT_TemplateOpener);
+  EXPECT_TOKEN(Tokens[16], tok::greater, TT_TemplateCloser);
----------------
carlosgalvezp wrote:

Ok, thanks for the clarification!

https://github.com/llvm/llvm-project/pull/110971


More information about the cfe-commits mailing list