<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Incomplete AST related to std::initializer_list"
   href="http://llvm.org/bugs/show_bug.cgi?id=22367">22367</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incomplete AST related to std::initializer_list
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++11
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>abramo.bagnara@bugseng.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>For the following source:

#include <initializer_list>
typedef std::initializer_list<int> T;

void f(T);

template <typename U>
void g(U);

int main() {
  f(T{0});
  g(T{0});
}

We get this AST (initial part is omitted as it is not relevant):

`-FunctionDecl 0x7960cc0 <line:9:1, line:12:1> line:9:5 main 'int (void)'
  `-CompoundStmt 0x7962d50 <col:12, line:12:1>
    |-CallExpr 0x7962180 <line:10:3, col:9> 'void'
    | |-ImplicitCastExpr 0x7962168 <col:3> 'void (*)(T)'
<FunctionToPointerDecay>
    | | `-DeclRefExpr 0x79620e0 <col:3> 'void (T)' lvalue Function
0x7960940 'f' 'void (T)'
    | `-CXXConstructExpr 0x79627a8 <col:6, col:8> 'T':'class
std::initializer_list<int>' 'void (class std::initializer_list<int> &&)
noexcept' elidable
    |   `-MaterializeTemporaryExpr 0x7962550 <col:6, col:8> 'class
std::initializer_list<int>' xvalue
    |     `-CXXStdInitializerListExpr 0x7961fa8 <col:6, col:8>
'T':'class std::initializer_list<int>'
    |       `-MaterializeTemporaryExpr 0x7961f90 <col:6, col:8> 'const
int [1]' xvalue
    |         `-InitListExpr 0x7961f48 <col:6, col:8> 'const int [1]'
    |           `-IntegerLiteral 0x7960e20 <col:7> 'int' 0
    `-CallExpr 0x7962cd0 <line:11:3, col:9> 'void'
      |-ImplicitCastExpr 0x7962cb8 <col:3> 'void (*)(class
std::initializer_list<int>)' <FunctionToPointerDecay>
      | `-DeclRefExpr 0x7962c60 <col:3> 'void (class
std::initializer_list<int>)' lvalue Function 0x7962b60 'g' 'void (class
std::initializer_list<int>)' (FunctionTemplate 0x7960c20 'g')
      `-CXXConstructExpr 0x7962d18 <col:6, col:8> 'class
std::initializer_list<int>':'class std::initializer_list<int>' 'void
(class std::initializer_list<int> &&) noexcept' elidable
        `-MaterializeTemporaryExpr 0x7962d00 <col:6, col:8> 'class
std::initializer_list<int>' xvalue
          `-CXXStdInitializerListExpr 0x7962910 <col:6, col:8>
'T':'class std::initializer_list<int>'
            `-MaterializeTemporaryExpr 0x79628f8 <col:6, col:8> 'const
int [1]' xvalue
              `-InitListExpr 0x79628b0 <col:6, col:8> 'const int [1]'
                `-IntegerLiteral 0x7962848 <col:7> 'int' 0

This misses any reference to TypeLoc for T.

In

<a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150126/122153.html">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150126/122153.html</a>

Richard Smith points that a NoOp CXXFunctionalCastExpr is missing between
MaterializeTemporaryExpr and CXXStdInitializerListExpr.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>