[Bug c++/93155] Error when compiling Boost MP11 mp_similar

2020-01-06 Thread tobias.loew at steag dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93155

Tobias Loew  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |INVALID

[Bug c++/93155] Error when compiling Boost MP11 mp_similar

2020-01-05 Thread tobias.loew at steag dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93155

--- Comment #3 from Tobias Loew  ---
After reading the standard carefully, I figured out that this is not an error
since the rewrite as function templates is ambiguous:

template struct mp_similar_impl {};

template 
void f(mp_similar_impl) {}

template class L, class... T1, class... T2> 
void f(mp_similar_impl, L>) {}

int main() {
f(mp_similar_impl, std::list>{});  // error ambiguous
}

[Bug c++/93155] Error when compiling Boost MP11 mp_similar

2020-01-05 Thread tobias.loew at steag dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93155

--- Comment #2 from Tobias Loew  ---
// here is a minimal example (extracted from boost/mp11/function.hpp)

template
struct s{};

template struct mp_similar_impl;

template struct mp_similar_impl
{
using type = int;
};

// commenting the following specialization removes the error
template class L, class... T1, class... T2> struct
mp_similar_impl, L>
{
using type = int;
};

int main(){
mp_similar_impl, s>::type v;
}

[Bug c++/93155] New: Error when compiling Boost MP11 mp_similar

2020-01-04 Thread tobias.loew at steag dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93155

Bug ID: 93155
   Summary: Error when compiling Boost MP11 mp_similar
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: tobias.loew at steag dot com
  Target Milestone: ---

The following code results in an ambiguity-error:

#include 
#include 

int main(){
static constexpr bool b = boost::mp11::mp_similar,
std::list>::value;
}



Please find here an example:
https://godbolt.org/z/Wzaa6_