<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Dec 5, 2008, at 8:01 PM, Sebastian Redl wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Douglas Gregor wrote:<br><blockquote type="cite">Author: dgregor<br></blockquote><blockquote type="cite">Date: Fri Dec  5 12:15:24 2008<br></blockquote><blockquote type="cite">New Revision: 60597<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=60597&view=rev">http://llvm.org/viewvc/llvm-project?rev=60597&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Representation of template type parameters and non-type template<br></blockquote><blockquote type="cite">parameters, with some semantic analysis:<br></blockquote><blockquote type="cite">  - Template parameters are introduced into template parameter scope<br></blockquote><blockquote type="cite">  - Complain about template parameter shadowing (except in Microsoft mode)<br></blockquote><blockquote type="cite">  <br></blockquote>Looks pretty good. I'm a bit worried that this approach means that pretty much every bit of Sema code that does some kind of type or capability checking has to be aware of template types and defer their checking. Is this correct? If so, is there any way we can avoid it? I'm envisioning bugs en masse that only appear in template code.</div></blockquote><div><br></div><div>This is absolutely correct. Before checking whether a particular expression or declaration is valid, we will need to check whether its parts are dependent (dependent types, type-dependent expressions, value-dependent expressions, etc.). Frankly, I don't think there's any way around it. Getting some level of template support into the compiler early perhaps means that we can be <span class="Apple-style-span" style="font-family: 'Lucida Grande'; font-size: 11px; white-space: pre; ">conscientious about adding template support for something as soon as we add the non-template support for it. We should try to enforce this through the type system.</span></div><div><br></div><div>The dependent-types computation will be coming later today.</div><div><br></div><blockquote type="cite"><div><blockquote type="cite">     // If this scope is a function or contains breaks/continues, remember it.<br></blockquote><blockquote type="cite">-    if (Flags & FnScope)       FnParent = this;<br></blockquote><blockquote type="cite">-    if (Flags & BreakScope)    BreakParent = this;<br></blockquote><blockquote type="cite">-    if (Flags & ContinueScope) ContinueParent = this;<br></blockquote><blockquote type="cite">-    if (Flags & BlockScope)  BlockParent = this;<br></blockquote><blockquote type="cite">-    +    if (Flags & FnScope)       <span class="Apple-tab-span" style="white-space:pre">      </span>    FnParent = this;<br></blockquote><blockquote type="cite">+    if (Flags & BreakScope)    <span class="Apple-tab-span" style="white-space:pre">  </span>    BreakParent = this;<br></blockquote><blockquote type="cite">+    if (Flags & ContinueScope) <span class="Apple-tab-span" style="white-space:pre">      </span>    ContinueParent = this;<br></blockquote><blockquote type="cite">+    if (Flags & BlockScope)    <span class="Apple-tab-span" style="white-space:pre">    </span>    BlockParent = this;<br></blockquote><blockquote type="cite">+    if (Flags & TemplateParamScope) TemplateParamParent = this;<br></blockquote><blockquote type="cite">     DeclsInScope.clear();<br></blockquote><blockquote type="cite">  <br></blockquote>Who let the tabs in the house? :-)</div></blockquote><div><br></div><div>Ugh, sorry. For various reasons that cause me trauma, I'm stuck using a badly-configured emacs within a terminal. ARGH!</div><div><br></div><blockquote type="cite"><div><blockquote type="cite"> +  if (PrevDecl && isTemplateParameterDecl(PrevDecl)) {<br></blockquote><blockquote type="cite">+    // Maybe we will complain about the shadowed template parameter.<br></blockquote><blockquote type="cite">+    InvalidDecl +      = InvalidDecl || DiagnoseTemplateParameterShadow(D.getIdentifierLoc(), +<span class="Apple-tab-span" style="white-space:pre">   </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-tab-span" style="white-space:pre">    </span>       PrevDecl);<br></blockquote><blockquote type="cite">+    // Just pretend that we didn't see the previous declaration.<br></blockquote><blockquote type="cite">+    PrevDecl = 0;<br></blockquote><blockquote type="cite">+  }<br></blockquote><blockquote type="cite">  <br></blockquote>Wouldn't that be better formatted by breaking before or after the ||? </div></blockquote><div><br></div>Yeah.</div><div><br><blockquote type="cite"><div>At least there are a lot of tabs in the final line. Your editor settings seem to be messed up.<br></div></blockquote></div><div><br></div>Oh, you can't imagine how message up they are! I'll try to fix...<div><br><div><span class="Apple-tab-span" style="white-space:pre">       </span>- Doug<br></div></div></body></html>