Skip to content
  1. Aug 26, 2007
  2. Aug 25, 2007
    • Chris Lattner's avatar
      new testcase · 1bc6fac5
      Chris Lattner authored
      llvm-svn: 41406
      1bc6fac5
    • Chris Lattner's avatar
      27f00282
    • Steve Naroff's avatar
      · 46c72915
      Steve Naroff authored
      Surpress the UsualUnaryConversions for compound assignment operators. This change
      eliminates the possibility that the left hand expression is an ImplicitCastExpr.
      As a result, I removed the check for ImplicitCastExpr in Expr::isLvalue().
      
      This results in the following AST's...
      
      [dylan:~/llvm/tools/clang] admin% cat fix.c
      
      short x; void test4(char c) { 
        x += c; 
        x = x + c;
      }
      [dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang fix.c -parse-ast-dump
      Read top-level variable decl: 'x'
      
      void test4(char c)
      (CompoundStmt 0x2605d30
        (CompoundAssignOperator 0x2605c40 'short' '+='
          (DeclRefExpr 0x2605c00 'short' Decl='x' 0x2605a80)
          (DeclRefExpr 0x2605c20 'char' Decl='c' 0x2605bc0))
        (BinaryOperator 0x2605d10 'short' '='
          (DeclRefExpr 0x2605c60 'short' Decl='x' 0x2605a80)
          (ImplicitCastExpr 0x2605d00 'short'
            (BinaryOperator 0x2605ce0 'int' '+'
              (ImplicitCastExpr 0x2605cc0 'int'
                (DeclRefExpr 0x2605c80 'short' Decl='x' 0x2605a80))
              (ImplicitCastExpr 0x2605cd0 'int'
                (DeclRefExpr 0x2605ca0 'char' Decl='c' 0x2605bc0))))))
      
      llvm-svn: 41404
      46c72915
    • Chris Lattner's avatar
      read and ignore the body of a namespace. · 479ed3aa
      Chris Lattner authored
      llvm-svn: 41403
      479ed3aa
    • Steve Naroff's avatar
      Change Expr::isLvalue() to properly deal with ImplicitCastExpr's. · e2562ff9
      Steve Naroff authored
      This fixes the following bug...
      
      t.c:1:31: error: expression is not assignable
      short x; void foo(char c) { x += c; }
      
      This case, among others are now captured in implicit-casts.c.
      
      llvm-svn: 41402
      e2562ff9
Loading