Fix build: move Q_REQUIRED_RESULT to the right position

If you're using GCC 7 or Clang 4, Q_REQUIRED_RESULT expands to
[[nodiscard]] that must appear in as specific place on the line.

 qcompilerdetection.h:1182:29: error: attribute ignored [-Werror=attributes]
 qtestsystem.h:58:12: note: in expansion of macro ‘Q_REQUIRED_RESULT’
     static Q_REQUIRED_RESULT bool qWaitFor(Functor predicate, int timeout = 5000)
            ^~~~~~~~~~~~~~~~~

Change-Id: I0b48fc8e90304e0dacc3fffd14e80ede168d5c6b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Thiago Macieira 2017-09-26 17:00:22 -07:00 committed by Shawn Rutledge
parent ef0129bb66
commit 9fcbef15f6

View File

@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE
namespace QTest
{
template <typename Functor>
static Q_REQUIRED_RESULT bool qWaitFor(Functor predicate, int timeout = 5000)
Q_REQUIRED_RESULT static bool qWaitFor(Functor predicate, int timeout = 5000)
{
// We should not spint the event loop in case the predicate is already true,
// otherwise we might send new events that invalidate the predicate.