1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 01:45:33 +02:00

Add operator name test for c++20 three-way comparison

This commit is contained in:
Igor V. Kovalenko 2023-01-20 01:36:29 +03:00 committed by Jonah Graham
parent ae8da7ef88
commit f13157720e

View file

@ -4181,6 +4181,18 @@ public class AST2CPPTests extends AST2CPPTestBase {
assertEquals(col.getName(158).toString(), "operator >");
}
// struct C {
// auto operator<=>(const C&);
// };
public void testThreeWayComparisonOperatorName() throws Exception {
IASTTranslationUnit tu = parse(getAboveComment(), CPP, ScannerKind.STDCPP20);
NameCollector col = new NameCollector();
tu.accept(col);
assertEquals(col.size(), 4);
assertEquals(col.getName(1).toString(), "operator <=>");
}
// typedef int I;
// typedef int I;
// typedef I I;