| @@ -1291,6 +1291,21 @@ TEST_F(QualifierFixerTest, WithCpp11Attribute) { |
|
|
| 1291 |
1291 |
"[[maybe_unused]] constexpr static int A", Style); |
| 1292 |
1292 |
} |
| 1293 |
1293 |
|
|
1294 |
+TEST_F(QualifierFixerTest, WithQualifiedTypeName) { |
|
1295 |
+auto Style = getLLVMStyle(); |
|
1296 |
+ Style.QualifierAlignment = FormatStyle::QAS_Custom; |
|
1297 |
+ Style.QualifierOrder = {"constexpr", "type", "const"}; |
|
1298 |
+ |
|
1299 |
+verifyFormat("constexpr ::int64_t x{1};", "::int64_t constexpr x{1};", Style); |
|
1300 |
+verifyFormat("constexpr std::int64_t x{123};", |
|
1301 |
+"std::int64_t constexpr x{123};", Style); |
|
1302 |
+verifyFormat("constexpr ::std::int64_t x{123};", |
|
1303 |
+"::std::int64_t constexpr x{123};", Style); |
|
1304 |
+ |
|
1305 |
+ Style.TypeNames.push_back("bar"); |
|
1306 |
+verifyFormat("constexpr foo::bar x{12};", "foo::bar constexpr x{12};", Style); |
|
1307 |
+} |
|
1308 |
+ |
| 1294 |
1309 |
TEST_F(QualifierFixerTest, DisableRegions) { |
| 1295 |
1310 |
FormatStyle Style = getLLVMStyle(); |
| 1296 |
1311 |
Style.QualifierAlignment = FormatStyle::QAS_Custom; |