Fix tst_moc for C++17

The throw() specification is no longer accepted in C++17 mode, so remove that.

Also pass the -std=c++1z to the compiler as Qt is going to require C++17 soon

Change-Id: I6d249e574d90cd1cf5c0ea595830d2db07681050
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Olivier Goffart 2019-12-05 14:05:11 +01:00
parent d8fa009a15
commit b0498b1864
4 changed files with 5 additions and 118 deletions

View File

@ -2283,49 +2283,6 @@
"inputFile": "slots-with-void-template.h",
"outputRevision": 67
},
{
"classes": [
{
"className": "InlineSlotsWithThrowDeclaration",
"qualifiedClassName": "InlineSlotsWithThrowDeclaration",
"slots": [
{
"access": "public",
"name": "a",
"returnType": "void"
},
{
"access": "public",
"name": "b",
"returnType": "void"
},
{
"access": "public",
"name": "c",
"returnType": "void"
},
{
"access": "public",
"name": "d",
"returnType": "void"
},
{
"access": "public",
"name": "e",
"returnType": "void"
}
],
"superClasses": [
{
"access": "public",
"name": "QObject"
}
]
}
],
"inputFile": "task189996.h",
"outputRevision": 67
},
{
"classes": [
{

View File

@ -15,7 +15,7 @@ cross_compile: DEFINES += MOC_CROSS_COMPILED
HEADERS += using-namespaces.h no-keywords.h task87883.h c-comments.h backslash-newlines.h oldstyle-casts.h \
slots-with-void-template.h qinvokable.h namespaced-flags.h trigraphs.h \
escapes-in-string-literals.h cstyle-enums.h qprivateslots.h gadgetwithnoenums.h \
dir-in-include-path.h single_function_keyword.h task192552.h task189996.h \
dir-in-include-path.h single_function_keyword.h task192552.h \
task234909.h task240368.h pure-virtual-signals.h cxx11-enums.h \
cxx11-final-classes.h \
cxx11-explicit-override-control.h \

View File

@ -1,47 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
// inline functions can have throw declarations
#ifndef TASK189996_H
#define TASK189996_H
#include <QObject>
class InlineSlotsWithThrowDeclaration : public QObject
{
Q_OBJECT
public slots:
void a() throw() { }
void b() const throw() { }
void c() throw();
void d() throw(int) { }
void e() const throw(int,double) { }
};
#endif

View File

@ -630,7 +630,6 @@ public:
private slots:
void initTestCase();
void slotWithException() throw(MyStruct);
void dontStripNamespaces();
void oldStyleCasts();
void warnOnExtraSignalSlotQualifiaction();
@ -672,7 +671,6 @@ private slots:
void templateGtGt();
void qprivateslots();
void qprivateproperties();
void inlineSlotsWithThrowDeclaration();
void warnOnPropertyWithoutREAD();
void constructors();
void typenameWithUnsigned();
@ -781,12 +779,6 @@ void tst_Moc::initTestCase()
#endif
}
void tst_Moc::slotWithException() throw(MyStruct)
{
// be happy
QVERIFY(true);
}
void tst_Moc::dontStripNamespaces()
{
Sender sender;
@ -821,7 +813,7 @@ void tst_Moc::oldStyleCasts()
QStringList args;
args << "-c" << "-x" << "c++" << "-Wold-style-cast" << "-I" << "."
<< "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++11" << "-";
<< "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++1z" << "-";
proc.start("gcc", args);
QVERIFY(proc.waitForStarted());
proc.write(mocOut);
@ -891,7 +883,7 @@ void tst_Moc::inputFileNameWithDotsButNoExtension()
QStringList args;
args << "-c" << "-x" << "c++" << "-I" << ".."
<< "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++11" << "-";
<< "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++1z" << "-";
proc.start("gcc", args);
QVERIFY(proc.waitForStarted());
proc.write(mocOut);
@ -1171,7 +1163,7 @@ void tst_Moc::ignoreOptionClashes()
QStringList gccArgs;
gccArgs << "-c" << "-x" << "c++" << "-I" << ".."
<< "-I" << qtIncludePath << "-I" << includeDir << "-o" << "/dev/null"
<< "-fPIC" << "-std=c++11" << "-";
<< "-fPIC" << "-std=c++1z" << "-";
proc.start("gcc", gccArgs);
QVERIFY(proc.waitForStarted());
proc.write(mocOut);
@ -1590,21 +1582,6 @@ void tst_Moc::qprivateproperties()
}
#include "task189996.h"
void InlineSlotsWithThrowDeclaration::c() throw() {}
void tst_Moc::inlineSlotsWithThrowDeclaration()
{
InlineSlotsWithThrowDeclaration tst;
const QMetaObject *mobj = tst.metaObject();
QVERIFY(mobj->indexOfSlot("a()") != -1);
QVERIFY(mobj->indexOfSlot("b()") != -1);
QVERIFY(mobj->indexOfSlot("c()") != -1);
QVERIFY(mobj->indexOfSlot("d()") != -1);
QVERIFY(mobj->indexOfSlot("e()") != -1);
}
void tst_Moc::warnOnPropertyWithoutREAD()
{
#ifdef MOC_CROSS_COMPILED
@ -1866,7 +1843,7 @@ void tst_Moc::notifyError()
QStringList args;
args << "-c" << "-x" << "c++" << "-I" << "."
<< "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++11" << "-";
<< "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-std=c++1z" << "-";
proc.start("gcc", args);
QVERIFY(proc.waitForStarted());
proc.write(mocOut);