[LLVMbugs] [Bug 22465] New: An extra InitListExpr in r227424 likely caused by DR1467

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 4 14:05:31 PST 2015


http://llvm.org/bugs/show_bug.cgi?id=22465

            Bug ID: 22465
           Summary: An extra InitListExpr in r227424 likely caused by
                    DR1467
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: lvoufo at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For the source:

#include <initializer_list>

typedef std::initializer_list<bool> T;
struct A {
  A(T) {}
};

void f() {
  T x;
  A y = {x};
}

in r224592 we used to get with -ast-print for last function:

void f() {
    T x;
    A y = { x };
}

in r227424 we get:


void f() {
    T x;
    A y = { { { x } } };
}

The difference comes from different AST, r224592:

    `-DeclStmt 0x72db9a8 <line:10:3, col:12>
      `-VarDecl 0x72db1d0 <col:3, col:11> col:5 y 'struct A' cinit
        `-CXXConstructExpr 0x72db970 <col:9, col:11> 'struct A' 'void (T)'
          `-CXXConstructExpr 0x72db818 <col:10> 'T':'class
std::initializer_list<_Bool>' 'void (const class
std::initializer_list<_Bool> &) noexcept'
            `-ImplicitCastExpr 0x72db640 <col:10> 'const class
std::initializer_list<_Bool>' lvalue <NoOp>
              `-DeclRefExpr 0x72db228 <col:10> 'T':'class
std::initializer_list<_Bool>' lvalue Var 0x72dacb0 'x' 'T':'class
std::initializer_list<_Bool>'


while r227424:

    `-DeclStmt 0x8c99f08 <line:10:3, col:12>
      `-VarDecl 0x8c996e0 <col:3, col:11> col:5 y 'struct A' cinit
        `-CXXConstructExpr 0x8c99ed0 <col:9, col:11> 'struct A' 'void (T)'
          `-CXXConstructExpr 0x8c99d78 <col:9, col:11> 'T':'class
std::initializer_list<_Bool>' 'void (const class
std::initializer_list<_Bool> &) noexcept'
            `-InitListExpr 0x8c99b68 <col:9, col:11> 'const class
std::initializer_list<_Bool>' lvalue
              `-ImplicitCastExpr 0x8c99b50 <col:10> 'const class
std::initializer_list<_Bool>' lvalue <NoOp>
                `-DeclRefExpr 0x8c99738 <col:10> 'T':'class
std::initializer_list<_Bool>' lvalue Var 0x8c991c0 'x' 'T':'class
std::initializer_list<_Bool>'

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150204/825c963a/attachment.html>


More information about the llvm-bugs mailing list