Strange error with std::is_nothrow_copy_constructible, can't isolate

I'm getting a really weird error I can't understand. I can't isolate it for some reason and I can't figure out what is triggering it.

Here's the error:
And here's the code:

I've tried several times to isolate the cause but this is really baffling me. Any ideas? I couldn't find any similar issues through googling.
Excerpt from the errors:
      no member named 'value' in
      'std::is_nothrow_copy_constructible<std::less<unsigned short> >'
Yet this program compiles fine:
#include <iostream>
#include <iomanip>
#include <functional>

int main()
	std::cout << std::boolalpha
	          << std::is_nothrow_copy_constructible<std::less<unsigned short>>::value
	          << std::endl;
} (it compiles on my system with the same compiler and same settings, even in the same source as that which is giving me errors)
I wonder if it is some include order issue.

You include the project header files first (which include the unseen "<lacewing.h>" header), so I'm wondering if they may have something in them that is borking things up for what is included later in the file. Do you have the same issue if you move the local header files after the system headers in the include order?
I've messed around with the include orders some and it doesn't affect the project nor my attempted isolations.

lacewing.h is part of liblacewing:

This really has me confused - I was actually hoping that it was just something in lacewing.h, but I still can't figure it out.
Last edited on
@ L B: First a caveat - This is somewhat above my skill level but digging into problems like this is how I try to learn.

That being said, I used your command line with g++ and the only errors reported were:
src/RelayServer.cpp:50:9: error: function ‘LwRelay::Server::Impl::Impl(LwRelay::Server::Impl&&)’ defaulted on its first declaration with an exception-specification that differs from the implicit declaration ‘LwRelay::Server::Impl::Impl(LwRelay::Server::Impl&&)’
Impl(Impl &&) noexcept(true) = default;

src/RelayServer.cpp:52:15: error: function ‘LwRelay::Server::Impl& LwRelay::Server::Impl::operator=(LwRelay::Server::Impl&&)’ defaulted on its first declaration with an exception-specification that differs from the implicit declaration ‘LwRelay::Server::Impl& LwRelay::Server::Impl::operator=(LwRelay::Server::Impl&&)’
Impl &operator=(Impl &&) noexcept(true) = default;

Googling these errors I found these posts:
The last comment is interesting.

A bug causes clang++ to report the additional errors and here is the suggested work around:

An example reproducing the error

$ cat main.cpp
#include <set>

struct Foo{
    std::set<int> bar; // compiles if commented
    Foo(Foo &&) noexcept(true)= default;  // error
	// Foo(Foo &&) = default; // compiles 
int main(){ }

Compiled with Debian clang version 3.3-9 I get the same errors that you posted starting with:
no member named 'value' in 'std::is_nothrow_copy_constructible<std::less<int> >'

I get no errors by removing noexcept(true) from the Impl move ctor and move assignment operator in RelayServer.cpp.

As I said I'm plowing new ground here but hopefully this info will help you solve your problem.
Last edited on
Wow, I didn't know that the noexcept specifiers were responsible - that was completely out of my mind.

I wrote this code originally a long time ago before I understood the correct way to use noexcept specifiers - thanks to you discovering that that was the issue, I've fixed it and it now passes syntax-only compilation! Thanks!

This is the commit that fixes the issue:
You're welcome from a fellow Texan.
Topic archived. No new replies allowed.