<div dir="ltr">See <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1755" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1755</a><br><div><br></div><div>This is a known area of difference between compilers; Clang is behaving as specified by the standard, but the standard is likely to be changed to specify different rules in the near future...</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 27, 2014 at 2:59 AM, Maxime van Noppen <span dir="ltr"><<a href="mailto:maxime.van.noppen@gmail.com" target="_blank">maxime.van.noppen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>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" target="_blank">gcc.godbolt.org</a>: <a href="http://goo.gl/5mNiY6" target="_blank">http://goo.gl/5mNiY6</a></div><div>--------------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>// Error on this line:<br><p 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>Thanks!</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br>Maxime<br>
</font></span></div>
<br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>