boost-ext / di

C++14 Dependency Injection Library
https://boost-ext.github.io/di
1.14k stars 138 forks source link

Simple facade function over di::bind compiles in clang, but does not in gcc #429

Closed Warchant closed 5 years ago

Warchant commented 5 years ago

Expected Behavior

clang, apple clang and gcc should compile this code:

https://godbolt.org/z/0SQkcR

Actual Behavior

clang compiles, gcc does not

Steps to Reproduce the Problem

Just look at https://godbolt.org/z/0SQkcR

Specifications

krzysztof-jusiak commented 5 years ago

Thanks, @Warchant.

GCC requires a template keyword in that context; The issue is not really related to DI.

template <typename... T>
auto useDerived(){
    return boost::di::bind<Base*[]>.template to<T...>();
}

The following work fine in both GCC and clang -> https://godbolt.org/z/WlHC3B