[Bug c++/58046] template operator= in SFINAE class

2016-01-21 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58046

Paolo Carlini  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |6.0

--- Comment #4 from Paolo Carlini  ---
Done.

[Bug c++/58046] template operator= in SFINAE class

2016-01-21 Thread paolo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58046

--- Comment #3 from paolo at gcc dot gnu.org  ---
Author: paolo
Date: Thu Jan 21 10:55:30 2016
New Revision: 232671

URL: https://gcc.gnu.org/viewcvs?rev=232671&root=gcc&view=rev
Log:
2016-01-21  Paolo Carlini  

PR c++/58046
* g++.dg/cpp0x/pr58046.C: New.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/pr58046.C
Modified:
trunk/gcc/testsuite/ChangeLog

[Bug c++/58046] template operator= in SFINAE class

2016-01-21 Thread paolo.carlini at oracle dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58046

--- Comment #2 from Paolo Carlini  ---
This is fixed in trunk. I'm adding a testcase and closing the bug.

[Bug c++/58046] template operator= in SFINAE class

2013-08-03 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58046

Daniel Krügler  changed:

   What|Removed |Added

 CC||daniel.kruegler@googlemail.
   ||com

--- Comment #1 from Daniel Krügler  ---
The same problem occurs for gcc 4.9.0 20130616 (experimental) as well.

A version without any dependencies to the library headers:

//
template
struct enable_if {};

template
struct enable_if
{
  using type = T;
};

template
struct is_true
{
  static constexpr bool value = true;
};

extern void* enabler;

template ::value>::type*& = enabler>
class A
{
public:
A()
{}
template 
A& operator=( A&& rhs )
{
return *this;
}
};

int main()
{
A a_i;
A a_d;

a_i = a_d;
}
//-

Gives as well:

"
main.cpp|36|required from here|
main.cpp|36|internal compiler error: in unify, at cp/pt.c:17325|
"

It is interesting to note that a variation of this sfinae construction doesn't
produce the ICE:

template ::value, bool>::type =
false>
class A
{
public:
A()
{}
template 
A& operator=( A&& rhs )
{
return *this;
}
};

int main()
{
A a_i;
A a_d;

a_i = a_d;
}

[Bug c++/58046] template operator= in SFINAE class

2013-08-01 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58046

Paolo Carlini  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2013-08-01
 Ever confirmed|0   |1