<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 29, 2015 at 4:06 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Thu, Jan 29, 2015 at 2:24 AM, Abramo Bagnara <span dir="ltr"><<a href="mailto:abramo.bagnara@bugseng.com" target="_blank">abramo.bagnara@bugseng.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Il 28/01/2015 23:07, Richard Smith ha scritto:<br>
> Fixed in r227377.<br>
<br>
I'm not sure it is related to your commit, but trying to validate your<br>
changes I've discovered a regression between r224592 and r227424.<br>
<br>
For the source:<br>
<br>
#include <initializer_list><br>
<br>
typedef std::initializer_list<bool> T;<br>
struct A {<br>
  A(T) {}<br>
};<br>
<br>
void f() {<br>
  T x;<br>
  A y = {x};<br>
}<br>
<br>
in r224592 we used to get with -ast-print for last function:<br>
<br>
void f() {<br>
    T x;<br>
    A y = { x };<br>
}<br>
<br>
in r227424 we get:<br>
<br>
<br>
void f() {<br>
    T x;<br>
    A y = { { { x } } };<br>
}<br>
<br>
The difference comes from different AST, r224592:<br>
<br>
    `-DeclStmt 0x72db9a8 <line:10:3, col:12><br>
      `-VarDecl 0x72db1d0 <col:3, col:11> col:5 y 'struct A' cinit<br>
        `-CXXConstructExpr 0x72db970 <col:9, col:11> 'struct A' 'void (T)'<br>
          `-CXXConstructExpr 0x72db818 <col:10> 'T':'class<br>
std::initializer_list<_Bool>' 'void (const class<br>
std::initializer_list<_Bool> &) noexcept'<br>
            `-ImplicitCastExpr 0x72db640 <col:10> 'const class<br>
std::initializer_list<_Bool>' lvalue <NoOp><br>
              `-DeclRefExpr 0x72db228 <col:10> 'T':'class<br>
std::initializer_list<_Bool>' lvalue Var 0x72dacb0 'x' 'T':'class<br>
std::initializer_list<_Bool>'<br>
<br>
<br>
while r227424:<br>
<br>
    `-DeclStmt 0x8c99f08 <line:10:3, col:12><br>
      `-VarDecl 0x8c996e0 <col:3, col:11> col:5 y 'struct A' cinit<br>
        `-CXXConstructExpr 0x8c99ed0 <col:9, col:11> 'struct A' 'void (T)'<br>
          `-CXXConstructExpr 0x8c99d78 <col:9, col:11> 'T':'class<br>
std::initializer_list<_Bool>' 'void (const class<br>
std::initializer_list<_Bool> &) noexcept'<br>
            `-InitListExpr 0x8c99b68 <col:9, col:11> 'const class<br>
std::initializer_list<_Bool>' lvalue<br>
              `-ImplicitCastExpr 0x8c99b50 <col:10> 'const class<br>
std::initializer_list<_Bool>' lvalue <NoOp><br>
                `-DeclRefExpr 0x8c99738 <col:10> 'T':'class<br>
std::initializer_list<_Bool>' lvalue Var 0x8c991c0 'x' 'T':'class<br>
std::initializer_list<_Bool>'<br>
<br>
<br>
What I can see is:<br>
1) a NoOp ImplicitCastExpr apparently needless in both<br></blockquote><div><br></div></div></div><div>It's not needless, it's adding a 'const' qualifier to the lvalue.</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
2) an extra InitListExpr in r227424</blockquote><div><br></div></span><div>This is weird and looks wrong, but it's unlikely to be related to r227377. Possibly caused by the changes for DR1467?</div></div></div></div></blockquote><div><br></div><div>DR1467 is not completely backward compatible. For example, it breaks <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;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;float:none;display:inline!important;background-color:rgb(255,255,255)">PR12117 and there is an issue filed on this with the standard. </span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;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;float:none;display:inline!important;background-color:rgb(255,255,255)">I'm looking into temporary workarounds. </span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;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;float:none;display:inline!important;background-color:rgb(255,255,255)">This sample case does look weird, and I can take a look at it as soon as my schedule allows it, perhaps tonight or later in the week.</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;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;float:none;display:inline!important;background-color:rgb(255,255,255)">In the meantime, I have filed a bug on this, <a href="http://llvm.org/bugs/show_bug.cgi?id=22465">PR22465</a>. Sounds good?</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;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;float:none;display:inline!important;background-color:rgb(255,255,255)"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;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;float:none;display:inline!important;background-color:rgb(255,255,255)">-- Larisse.</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8000001907349px;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;float:none;display:inline!important;background-color:rgb(255,255,255)"><br></span></div><div><br></div></div><br></div></div>