[clang] cc8ed7b - [Format] Also test rvalue-qualified functions

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 4 03:17:35 PST 2022


Author: Sam McCall
Date: 2022-02-04T12:17:25+01:00
New Revision: cc8ed7b5aaa4ab9d11cb8a5bc97222df966e0f58

URL: https://github.com/llvm/llvm-project/commit/cc8ed7b5aaa4ab9d11cb8a5bc97222df966e0f58
DIFF: https://github.com/llvm/llvm-project/commit/cc8ed7b5aaa4ab9d11cb8a5bc97222df966e0f58.diff

LOG: [Format] Also test rvalue-qualified functions

Added: 
    

Modified: 
    clang/unittests/Format/FormatTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 565b125dd1bc..14942d1ba420 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -9719,9 +9719,9 @@ TEST_F(FormatTest, UnderstandsFunctionRefQualification) {
                        "void b() &;\n";
   verifyFormat(Prefix + "int* x;", DerivePointerAlignment);
   verifyFormat(Prefix + "int *x;", DerivePointerAlignment);
-  // Same if the function is an overloaded operator instead.
-  Prefix = "void operator()() &;\n"
-           "void operator()() &;\n";
+  // Same if the function is an overloaded operator, and with &&.
+  Prefix = "void operator()() &&;\n"
+           "void operator()() &&;\n";
   verifyFormat(Prefix + "int* x;", DerivePointerAlignment);
   verifyFormat(Prefix + "int *x;", DerivePointerAlignment);
   // However a space between cv-qualifiers and ref-qualifiers *is* evidence.


        


More information about the cfe-commits mailing list