[clang] [clang-format] Handle templated elaborated type specifier in function… (PR #77013)

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 20 13:54:46 PST 2024


================
@@ -14583,9 +14583,10 @@ TEST_F(FormatTest, UnderstandContextOfRecordTypeKeywords) {
   verifyFormat("template <> struct X < 15, i<3 && 42 < 50 && 33 < 28> {};");
   verifyFormat("int i = SomeFunction(a<b, a> b);");
 
-  // FIXME:
-  // This now gets parsed incorrectly as class definition.
-  // verifyFormat("class A<int> f() {\n}\nint n;");
+  verifyFormat("class A<int> f() {}\nint n;");
+  verifyFormat("template <typename T> class A<T> f() {}\nint n;");
+
+  verifyFormat("template <> class Foo<int> F() {\n} n;");
----------------
owenca wrote:

Please wrap after newlines.

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


More information about the cfe-commits mailing list