<div>On Fri Jan 24 2014 at 5:38:42 PM, JB Feldman <<a href="mailto:jb.feldman@kyrus-tech.com">jb.feldman@kyrus-tech.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hey guys,<br>
<br>
I'm a serious newbie at LLVMing. I've been trying to figure out how
to solve <br>
<a href="http://llvm.org/bugs/show_bug.cgi?id=18443" style="color:rgb(17,85,204);font-family:arial,sans-serif;font-size:13.333333969116211px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)" target="_blank">http://llvm.org/bugs/<u></u>show_bug.cgi?id=18443</a>.
<br>
<br>
I've discovered where the error is being triggered, and that is in
TreeTransform<Derived>::TransformUnaryExprOrTypeTraitExpr().
However, I don't feel that this is the correct place to fix the
problem, I think the correct place would be to make it so that
<pre style="font-size:small;font-family:monospace;white-space:pre-wrap;width:50em;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(255,255,255)">
sizeof(T::type);
and
sizeof(typename T::type);
</pre>
Parse to the same Expr.</div></blockquote><div><br></div><div>That would break the case where T::type is an expression rather than a type:</div><div><br></div><div>struct S { static const int type = 0; };</div><div>template<typename T> struct X {</div>
<div> int k = sizeof(T::type);</div><div>};</div><div>static_assert(X<S>().k == sizeof(int), "");</div><div><br></div><div>The right way to fix this is probably to detect the case of a ParenExpr containing a "type-shaped" expression (maybe just a dependent-scoped decl ref expr for now) in TransformUnaryExprOrTypeTrait, and to transform it into the intended type if the name instantiates to a type.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">I've been debugging clang with VS trying to
figure out where/when/how this thing is parsed, and all I ever see
(in Lexer::Lex) are headers being parsed. Can anyone point me to the
code that creates the Expr objects for this code? At the moment, I
can't even identify what type of Expr "typename T::type" would parse
to, let alone try to make "T::type" parse to the same thing.<br>
<br>
If you don't know the answer, is there a good place to start for
diving into developing on clang? I'm still not sure I'm clear on the
differences between parsing, AST, lexing, and sema transforms. I
would very much appreciate any help on these topics, anywhere
between someone saying, "hey, go read this readme/webpage" to
someone actually pointing me to the correct piece of code. I feel
like I've been spinning my wheels on this one. <br>
<br>
I really want to get involved in making clang more robust with
Windows (at some point probably including diving into the SEH
problem), I just seem to need some help getting started.<br>
<br>
Thanks,<br>
JB<br>
<br>
<br>
<br>
</div>
</blockquote>