<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 10, 2009, at 4:59 PM, Chris Lattner wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Feb 9, 2009, at 12:58 PM, Douglas Gregor wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><br>On Feb 9, 2009, at 12:05 PM, Sebastian Redl wrote:<br><br><blockquote type="cite">Douglas Gregor wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">Author: dgregor<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Date: Mon Feb  9 12:46:07 2009<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">New Revision: 64153<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=64153&view=rev">http://llvm.org/viewvc/llvm-project?rev=64153&view=rev</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Log:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Start processing template-ids as types when the template-name refers<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">to a class template. For example, the template-id 'vector<int>' now<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">has a nice, sugary type in the type system. What we can do now:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">- Parse template-ids like 'vector<int>' (where 'vector' names a<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">  class template) and form proper types for them in the type system.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">- Parse icky template-ids like 'A<5>' and 'A<(5 > 0)>' properly,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">  using (sadly) a bool in the parser to tell it whether '>' should<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">  be treated as an operator or not.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite">I suppose it can't be helped.<br></blockquote><br>The only other option I can think of would be to pass it as a boolean  <br>flag down the stack... that's almost worse :)</span></blockquote></div><br><div>Naive question: is this just a matter of parsing the expression starting at the right precedence level?</div></div></blockquote></div><br><div>Sadly, no; other operations at that same precedence level (<, <=, >=) can still show up. For example, </div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span>A< 5 < 0> *a;<br></div><div><br></div><div>is well-formed.</div><div><br></div><div>Plus, in C++0x, '>>' can also terminate a template-argument-list or a default template argument. (And there's some fancy footwork to be done to recover from "vector<vector<int>>" in C++98 mode).</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">       </span>- Doug<br></div></body></html>