mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-28 18:53:20 +02:00
Add operator name test for c++20 three-way comparison
This commit is contained in:
parent
ae8da7ef88
commit
f13157720e
1 changed files with 12 additions and 0 deletions
|
@ -4181,6 +4181,18 @@ public class AST2CPPTests extends AST2CPPTestBase {
|
||||||
assertEquals(col.getName(158).toString(), "operator >");
|
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 int I;
|
// typedef int I;
|
||||||
// typedef I I;
|
// typedef I I;
|
||||||
|
|
Loading…
Add table
Reference in a new issue