<div dir="ltr">Great thanks for the fast answer.<div><br></div><div>Cheers,</div><div>Lukas</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/11 Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Sun, Aug 11, 2013 at 10:16 AM, Lukas Vogel<br>
<<a href="mailto:lukedirtwalkerdev@gmail.com">lukedirtwalkerdev@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I recently found out that for the following sample:<br>
><br>
> class Pair {<br>
><br>
>   int a,b;<br>
><br>
> public:<br>
><br>
>   Pair(int f,int s){<br>
><br>
>     a=f;<br>
><br>
>     b=s;<br>
><br>
>   }<br>
><br>
> };<br>
><br>
><br>
> template <class T> class A : public Pair {<br>
><br>
>   A(int f, int s) : Pair(f,s){}<br>
><br>
> };<br>
><br>
><br>
> Clang produces a ParenListExpr as init expression for the Pair(f,s) call.<br>
><br>
><br>
> However if the class A has no template parameter i.e. just class A: public<br>
> Pair{<br>
><br>
> Clang produces a CXXConstructExpr as init expression .<br>
><br>
><br>
> Why does it matter if there is a template argument for the<br>
> CXXCtorInitializer ?<br>
><br>
<br>
</div>clang only builds a CXXConstructExpr when we know which constructor<br>
will be called.  That isn't possible if the base in question is<br>
dependent, or if we don't know which base will be initialized.  (In<br>
this particular case, we can tell the exact type of the base which<br>
will be initialized, but clang doesn't have code to reason about which<br>
cases are safe.)<br>
<span class="HOEnZb"><font color="#888888"><br>
-Eli<br>
</font></span></blockquote></div><br></div>