Skip to content
  • Daniel Dunbar's avatar
    Improve "assignment to cast" diagnostic. · c2223ab2
    Daniel Dunbar authored
     - Strip off extra parens when looking for casts.
     - Change the location info to point at the cast (instead of the
       assignment).
    
    For example, on
      
      int *b;
      #define a ((void*) b)
      void f0() {
        a = 10;
      }
      
    we now emit:
      
      /tmp/t.c:4:3: error: assignment to cast is illegal, lvalue casts are not supported
        a = 10;
        ^ ~
      /tmp/t.c:2:12: note: instantiated from:
      #define a ((void*) b)
                ~^~~~~~~~~~
      
    instead of:
      
      /tmp/t.c:4:5: error: expression is not assignable
        a = 10;
        ~ ^
    
    llvm-svn: 69114
    c2223ab2
Loading