This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/55058] [4.7/4.8 Regression] Unexpected invalid type conversion error


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55058

Sebastian Huber <sebastian.huber@embedded-brains.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #28518|0                           |1
        is obsolete|                            |
  Attachment #28527|0                           |1
        is obsolete|                            |

--- Comment #5 from Sebastian Huber <sebastian.huber@embedded-brains.de> 2012-10-26 13:28:08 UTC ---
Created attachment 28537
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28537
Test case.

Thanks for the hint to the delta tool.  This is great for automatic test case
reduction.

The test code is now:

template <typename T>
struct A { };

template <typename T>
struct B {
  B(const A<T> T::* p);
  typedef A<T> D;
};

template <typename T>
B<T>::B(const D T::* p) { }

struct C {
  C() : e() {};

  const A<C> e;
};

B<C> g(&C::e);

The crucial thing is the "typedef A<T> D".  It works, if we move it before the
constructor declaration "B(const A<T> T::* p)".  Removing the constructor
definition works also.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]