<div dir="ltr"><div style>Hi all,</div><div style><br></div><div style>While porting some code which compiles under gcc (up to 4.9) and MSVC (2012, 2013) I've came across this code snippet that is refused by clang and it's not obvious to me that it is a genuine error. I'm asking here before creating a bug report.<br>
<br>Code in <a href="http://gcc.godbolt.org">gcc.godbolt.org</a>: <a href="http://goo.gl/5mNiY6">http://goo.gl/5mNiY6</a></div><div style>--------------8<--------------8<--------------8<--------------8<--------------<br>
<div>#define BEFORE // No error if this line is commented</div><div>#define AFTER</div><div><br></div><div>template<typename T></div><div>struct Ptr</div><div>{</div><div> template<typename U, typename V> struct _Auto;</div>
<div>};</div><div><br></div><div>#ifdef BEFORE</div><div>Ptr<int> asd;</div><div>#endif</div><div><br></div><div>template<typename T></div><div>template<typename V></div><div>struct Ptr<T>::_Auto<void,V></div>
<div>{</div><div> static const int params[];</div><div>};</div><div>const void* q = &Ptr<int>::_Auto<void,void>::params;</div><div style>// Error on this line:<br><p class="" style="margin:0px 0px 9px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:rgb(51,51,51)">
// error: no member named 'params' in 'Ptr::_Auto'</p></div><div><br></div><div>#ifdef AFTER</div><div>Ptr<int> asd;</div><div>#endif</div></div><div>--------------8<--------------8<--------------8<--------------8<--------------<br>
</div><div><br></div><div><br></div><div style>Thanks!</div><div><br></div>-- <br>Maxime<br>
</div>