You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
There is a case not properly handled for SFINAE in the parser / semantic analysis. When a specialisation uses expressions involving constructors, at least of basic types (including void), SFINAE errors are not propagated and do not prevent selection of the specialisation when they should.
To Reproduce
The followig code exhibits the issue, see declaration of B b1 { ip };. This is marked as an error because the partial specialisation is selected when it should be rejected.
template <class, typename = void>
struct A
{
using type = int *;
};
template <class T>
struct A<T, decltype(void(typename T::p()))>
{
using type = typename T::p;
};
class d { };
class B {
public:
using p = typename A<d>::type;
public:
explicit B(p) {}
};
int *ip = nullptr;
B b1 { ip };
B::p jp = nullptr;
I have a fix which I will post shortly.
The text was updated successfully, but these errors were encountered:
… failure
This change prevents invalid partial specialisations from being chosen
when
instantiating a template in cases where the expression for the
type/value of a template parameter involves a constructor call.
… failure
This change prevents invalid partial specialisations from being chosen
when
instantiating a template in cases where the expression for the
type/value of a template parameter involves a constructor call.
… failure
This change prevents invalid partial specialisations from being chosen
when
instantiating a template in cases where the expression for the
type/value of a template parameter involves a constructor call.
)
This change prevents invalid partial specialisations from being chosen
when
instantiating a template in cases where the expression for the
type/value of a template parameter involves a constructor call.
Describe the bug
There is a case not properly handled for SFINAE in the parser / semantic analysis. When a specialisation uses expressions involving constructors, at least of basic types (including void), SFINAE errors are not propagated and do not prevent selection of the specialisation when they should.
To Reproduce
The followig code exhibits the issue, see declaration of
B b1 { ip };
. This is marked as an error because the partial specialisation is selected when it should be rejected.I have a fix which I will post shortly.
The text was updated successfully, but these errors were encountered: