<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">No, it should not work, because (i think) it is similar with the code as follows,<div><br></div><div>unsigned int int var = 0;</div><div><br></div><div>your problem is that you treat the typedef as macro here, so you think when processing unsigned Foo_t, it should be treated as unsigned int. </div><div><br></div><div>But, again, it's not macro.<br><br>--- <b>11年1月25日,周二, Marshall Clow <i><mclow.lists@gmail.com></i></b> 写道:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>发件人: Marshall Clow <mclow.lists@gmail.com><br>主题: [cfe-dev] Clang/C++ problem?<br>收件人: "CLang-list" <cfe-dev@cs.uiuc.edu><br>日期: 2011年1月25日,周二,上午5:08<br><br><div class="plainMail">Shouldn't this work?<br>If it should work, should I write up a bug?<br><br>$ cat
junk.cpp<br>> typedef int Foo_t;<br>> <br>> template <typename T><br>> T DoSomething ( T t) { return t; }<br>> <br>> int main ( int argc, char *argv [] ) {<br>> int foo = 23;<br>> DoSomething ( static_cast<unsigned int>(foo));<br>> DoSomething ( static_cast<unsigned Foo_t>(foo));<br>> return 0;<br>> }<br>> <br><br>$ g++ junk.cpp<br><br>$ clang junk.cpp<br>> junk.cpp:9:36: error: expected '>'<br>> DoSomething ( static_cast<unsigned Foo_t>(foo));<br>> ^<br>>
><br>> junk.cpp:9:27: note: to match this '<'<br>> DoSomething ( static_cast<unsigned Foo_t>(foo));<br>> ^<br>> 1 error generated.<br>> <br><br>Marshall Clow Idio Software <mailto:<a ymailto="mailto:mclow.lists@gmail.com" href="/mc/compose?to=mclow.lists@gmail.com">mclow.lists@gmail.com</a>><br><br>A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).<br> -- Yu Suzuki<br><br><br>_______________________________________________<br>cfe-dev mailing list<br><a ymailto="mailto:cfe-dev@cs.uiuc.edu" href="/mc/compose?to=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></div></blockquote></div></td></tr></table><br>