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

test.injections_concepts: Fails compilation with "-fconcepts" #410

Open
jamespharvey20 opened this issue May 3, 2019 · 1 comment
Open
Labels

Comments

@jamespharvey20
Copy link
Contributor

Expected Behavior

test.injections_concepts should be able to compile if __cpp_concepts is defined.

Actual Behavior

At first, test.injections_concepts appears to compile and pass. Technically, it does. And, it's on the website as a "Run this code!" example.

But, with further examination, because -fconcepts isn't used, __cpp_concepts isn't defined, so concepts.cpp winds up being a completely empty main().

Compiling with -fconcepts leads to the attached error, on gcc 9.1. (Similar errors on gcc 6.x, 7.x, 8.x.)

The full errors are attached, but it starts:

In file included from /home/jamespharvey20/home/code/di.git/extension/include/boost/di/extension/injections/concepts.hpp:12,
                 from /home/jamespharvey20/home/code/di.git/extension/test/injections/concepts.cpp:11:
/home/jamespharvey20/home/code/di.git/include/boost/di.hpp:3328:103: error: decltype cannot resolve address of overloaded function
 3328 |       ::boost::di::v1_1_0::detail::combine_t<::boost::di::v1_1_0::aux::function_traits_t<decltype(ctor)>, \
      |                                                                                                       ^
...
/home/jamespharvey20/home/code/di.git/include/boost/di.hpp:3328:104: error: template argument 1 is invalid
 3328 |       ::boost::di::v1_1_0::detail::combine_t<::boost::di::v1_1_0::aux::function_traits_t<decltype(ctor)>, \
      |                                                                                                        ^

I'm thinking it's not built by extension/test/CMakeLists.txt because of these errors, but I'm posting this because: (1) I'm hoping it can be fixed; and (2) as it's on the website as a "Run this code!" it makes it look like it's implemented and working.

Steps to Reproduce the Problem

  1. Modify /CMakeLists.txt to include -fconcepts in CMAKE_CXX_FLAGS for g++.
  2. Modify extension/test/CMakeLists.txt to include test(injections/concepts).
  3. Attempt compiling test.injections.concepts

Specifications

  • Version: git master (db2b599)
  • Platform: x86-64
  • Subsystem: Arch Linux
@kanstantsin-chernik
Copy link
Collaborator

Actually, I saw the same problem with msvc 19.23 /std:cpp20

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

No branches or pull requests

2 participants