diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-16 20:46:44 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-07-21 21:37:00 +0200 |
commit | 2dc1b659921d72aeac1c12d8c903de9704e6419f (patch) | |
tree | fc193e94b987e7545816195727610a37baf58415 | |
parent | f2b61d1160e935083b14e7b26f4a21821d015e68 (diff) |
Fix testReverseOperators::testReverseSumWithAmbiguity()
The test was marked QEXPECT_FAIL() since the code snippet does not
compile with clang:
main.cpp:7:9: error: overloaded 'operator-' must have at least one parameter of class or enumeration type
main.cpp:8:9: error: overloaded 'operator/' must have at least one parameter of class or enumeration type
With Clang 10, the compiler even crashes on Windows.
Remove the offending part.
Change-Id: I3d954f19884e42b61dcfc2e7a9ec4f2a31fd432b
Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r-- | sources/shiboken2/ApiExtractor/tests/testreverseoperators.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/sources/shiboken2/ApiExtractor/tests/testreverseoperators.cpp b/sources/shiboken2/ApiExtractor/tests/testreverseoperators.cpp index dc4801e18..496b55aaa 100644 --- a/sources/shiboken2/ApiExtractor/tests/testreverseoperators.cpp +++ b/sources/shiboken2/ApiExtractor/tests/testreverseoperators.cpp @@ -78,8 +78,6 @@ void TestReverseOperators::testReverseSumWithAmbiguity() struct B {};\n\ B operator+(const A&, const B&);\n\ B operator+(const B&, const A&);\n\ - int operator-(int, const A*);\n\ - int operator/(const A*, int);\n\ "; const char xmlCode[] = "\n\ <typesystem package=\"Foo\">\n\ @@ -89,12 +87,11 @@ void TestReverseOperators::testReverseSumWithAmbiguity() </typesystem>"; QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, false)); - QEXPECT_FAIL("", "Clang: Does not compile", Abort); QVERIFY(!builder.isNull()); AbstractMetaClassList classes = builder->classes(); const AbstractMetaClass *classA = AbstractMetaClass::findClass(classes, QLatin1String("A")); QVERIFY(classA); - QCOMPARE(classA->functions().count(), 6); + QCOMPARE(classA->functions().count(), 4); const AbstractMetaClass *classB = AbstractMetaClass::findClass(classes, QLatin1String("B")); QVERIFY(classB); @@ -118,19 +115,6 @@ void TestReverseOperators::testReverseSumWithAmbiguity() QVERIFY(reverseOp->isReverseOperator()); QCOMPARE(reverseOp->arguments().count(), 1); QCOMPARE(reverseOp->minimalSignature(), QLatin1String("operator+(A,B)")); - - reverseOp = classA->findFunction(QLatin1String("operator-")); - QVERIFY(reverseOp); - QCOMPARE(reverseOp->arguments().count(), 1); - QVERIFY(reverseOp->isPointerOperator()); - QVERIFY(reverseOp->isReverseOperator()); - - normalOp = classA->findFunction(QLatin1String("operator/")); - QVERIFY(normalOp); - QCOMPARE(normalOp->arguments().count(), 1); - QVERIFY(normalOp->isPointerOperator()); - QVERIFY(!normalOp->isReverseOperator()); - } |