aaronpuchert removed a reviewer: bkramer.
aaronpuchert added a comment.

I discovered an issue with variables, because there can be multiple definitions 
with the same `TypeLoc`:

  extern int a;
  int a, b;

We emit the warning for `b`, but we can't just put static in front of the 
declaration, as that would affect `a` as well. I haven't found a way to 
determine whether a `VarDecl` shares its type with another declaration, 
especially since global declarations don't even belong to a `DeclStmt`. We just 
get

  TranslationUnitDecl 0x1d0b598 <<invalid sloc>> <invalid sloc>
  |-...
  |-VarDecl 0x1d47b60 <<stdin>:1:1, col:12> col:12 a 'int' extern
  |-VarDecl 0x1d47c18 prev 0x1d47b60 <line:2:1, col:5> col:5 a 'int'
  `-VarDecl 0x1d47c90 <col:1, col:8> col:8 b 'int'

So I think I have to drop the fix-it hint there, but I can still emit a note.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59402/new/

https://reviews.llvm.org/D59402



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to