Skip to content

Commit

Permalink
Add operator name test for c++20 three-way comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
i-garrison authored and jonahgraham committed Jan 28, 2023
1 parent ae8da7e commit f131577
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4181,6 +4181,18 @@ public void testOperatorNames() throws Exception {
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;
Expand Down

0 comments on commit f131577

Please sign in to comment.