Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid reference to function concept w. trivial origin::Number usage #10

Open
JLospinoso opened this issue Mar 28, 2017 · 1 comment
Open

Comments

@JLospinoso
Copy link

Hello,

This simple program yields a compiler error:

#include <origin/core/concepts.hpp>

void foo(origin::Number x) { }

int main()
{
  foo(10);
}

The error is the following:

/home/jalospinoso/concepts/main.cpp: In function ‘int main()’:
/home/jalospinoso/concepts/main.cpp:7:9: error: invalid reference to function concept ‘template<class T> concept bool origin::Ordered()’
   foo(10);
         ^
/home/jalospinoso/concepts/main.cpp:7:9: error: cannot call function ‘void foo(auto:1) [with auto:1 = int]’
/home/jalospinoso/concepts/main.cpp:3:6: note:   constraints not satisfied
 void foo(origin::Number x) { }
      ^~~
In file included from /home/jalospinoso/concepts/main.cpp:1:0:
/usr/local/include/origin/core/concepts.hpp:442:10: error: invalid reference to function concept ‘template<class T> concept bool origin::Ordered()’
   return Ordered<T>
          ^~~~~~~~~~
/usr/local/include/origin/core/concepts.hpp:440:14: note: within ‘template<class T> concept bool origin::Number() [with T = int]’
 concept bool Number()
              ^~~~~~
/home/jalospinoso/concepts/main.cpp:7:9: note: ill-formed constraint
   foo(10);
         ^
CMakeFiles/concepts.dir/build.make:62: recipe for target 'CMakeFiles/concepts.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/concepts.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/concepts.dir/all' failed
make[1]: *** [CMakeFiles/concepts.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Is this related to this GCC bug?

Thanks in advance. The concepts TS is very exciting.

JLospinoso pushed a commit to JLospinoso/origin that referenced this issue Mar 28, 2017
@JLospinoso
Copy link
Author

I have a proposed fix: #11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant