[LLVMbugs] [Bug 13078] New: typeof

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 11 03:08:35 PDT 2012


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

             Bug #: 13078
           Summary: typeof
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: novino at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


int i = 99;
void
f1 (void)
{
  int j = sizeof(++i, i);
}

-- AST is well formed with all the info --
typedef char *__builtin_va_list;
int i = (IntegerLiteral 0xa744e08 <vla-15.c:5:9> 'int' 99)
;
void f1() (CompoundStmt 0xa745008 <vla-15.c:8:1, line:11:1>
  (DeclStmt 0xa744ff8 <line:10:2, col:24>
    0xa744f10 "int j =
      (ImplicitCastExpr 0xa744fe8 <col:10, col:23> 'int' <IntegralCast>
        (UnaryExprOrTypeTraitExpr 0xa744fd0 <col:10, col:23> 'unsigned int'
sizeof 
          (ParenExpr 0xa744fb8 <col:16, col:23> 'int'
            (BinaryOperator 0xa744fa0 <col:17, col:22> 'int' ','
              (UnaryOperator 0xa744f60 <col:17, col:19> 'int' prefix '++'
                (DeclRefExpr 0xa744f44 <col:19> 'int' lvalue Var 0xa744dd0 'i'
'int'))
              (ImplicitCastExpr 0xa744f90 <col:22> 'int' <LValueToRValue>
                (DeclRefExpr 0xa744f74 <col:22> 'int' lvalue Var 0xa744dd0 'i'
'int'))))))"))

-- IR for the same goes as follows, which has the missing ++i --

@i = global i32 99, align 4

define void @f1() nounwind {
  %j = alloca i32, align 4
  store i32 4, i32* %j, align 4
  ret void
}

PS: Located the problem to Parse/Visit UnaryExprOrTypeTraitExpr, where the
subexpression visit isn't happening.

Question : Are these type of parenthesis expressions or binary (comma) opeartor
allowed inside typeof and sizeof? tried searching specs but couldn't find any
concrete data.
a) j = sizeof(++i, i);
b) typeof(++i, i)j;

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list