Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Error while compiling Qt 5.0.2: incorrect "constexpr"-ness of qMax() overload on timeval arguments
Forum Updated to NodeBB v4.3 + New Features

Error while compiling Qt 5.0.2: incorrect "constexpr"-ness of qMax() overload on timeval arguments

Scheduled Pinned Locked Moved Installation and Deployment
1 Posts 1 Posters 996 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    reddish
    wrote on last edited by
    #1

    Hi all,

    While compiling Qt from the 5.0.2 tarball, I get the following error:

    kernel/qtimerinfo_unix.cpp:98:30: error: redeclaration ‘constexpr T qAbs(const T&) [with T = timeval]’ differs in ‘constexpr’
    timeval qAbs(const timeval &t)
    ^
    In file included from ../../include/QtCore/qglobal.h:1:0,
    from global/qt_pch.h:58:
    ../../include/QtCore/../../src/corelib/global/qglobal.h:483:27: error: from previous declaration ‘constexpr T qAbs(const T&) [with T = timeval]’
    Q_DECL_CONSTEXPR inline T qAbs(const T &t) { return t >= 0 ? t : -t; }
    ^
    kernel/qtimerinfo_unix.cpp: In function ‘constexpr T qAbs(const T&) [with T = timeval]’:
    kernel/qtimerinfo_unix.cpp:109:1: error: body of constexpr function ‘constexpr T qAbs(const T&) [with T = timeval]’ not a return-statement

    (............. plus a lot more ...............)

    Investigating the issue does indeed show a template specialization on qMax<timeval> that does not have the "constexpr" attribute, while the generic qMax<T> does.

    I am using g++ 4.8.2 on Debian/testing.

    Is there any easy way I can fix this? I already tried to remove the constexpr declaration on qMax<T> but the problem cascades to functions that use that.

    Any help is appreciated.

    Sidney

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved