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:
https://gist.github.com/LB--/6768509
And here's the code:
https://github.com/LB--/Lacewing-Relay

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:
error:
      no member named 'value' in
      'std::is_nothrow_copy_constructible<std::less<unsigned short> >'
Yet this program compiles fine:
1
2
3
4
5
6
7
8
9
10
#include <iostream>
#include <iomanip>
#include <functional>

int main()
{
	std::cout << std::boolalpha
	          << std::is_nothrow_copy_constructible<std::less<unsigned short>>::value
	          << std::endl;
}
http://ideone.com/6RMdnj (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:
https://github.com/udp/lacewing/blob/master/include/lacewing.h

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:
http://stackoverflow.com/questions/9180164/implicit-generated-members-and-noexcept
The last comment is interesting.

http://stackoverflow.com/questions/12332772/why-arent-container-move-assignment-operators-noexcept

A bug causes clang++ to report the additional errors and here is the suggested work around: http://lists.cs.uiuc.edu/pipermail/llvmbugs/2013-March/027718.html

An example reproducing the error

1
2
3
4
5
6
7
8
9
$ 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:
error:
no member named 'value' in 'std::is_nothrow_copy_constructible<std::less<int> >'
noexcept(is_nothrow_copy_constructible<_Compare>::value)


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:
https://github.com/LB--/Lacewing-Relay/commit/a8f415b6b1f715041b0d8a55fb80b16d52debacd
You're welcome from a fellow Texan.
Topic archived. No new replies allowed.