[llvm-bugs] [Bug 31781] New: -Wunused-const-variable doesn't warn for ObjC types if ARC is enabled
    via llvm-bugs 
    llvm-bugs at lists.llvm.org
       
    Thu Jan 26 19:58:21 PST 2017
    
    
  
https://llvm.org/bugs/show_bug.cgi?id=31781
            Bug ID: 31781
           Summary: -Wunused-const-variable doesn't warn for ObjC types if
                    ARC is enabled
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: david at herzka.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified
// test.m
static id const kIdConstant = @"abc";
static const int kIntConstant = 123;
int main(int argc, char const *argv[])
{
    return 0;
}
> clang -o test test.m -framework Foundation -Wunused-const-variable
test.m:3:17: warning: unused variable 'kIdConstant' [-Wunused-const-variable]
static id const kIdConstant = @"abc";
                ^
test.m:4:18: warning: unused variable 'kIntConstant' [-Wunused-const-variable]
static const int kIntConstant = 123;
                 ^
2 warnings generated.
> clang -o test test.m -framework Foundation -Wunused-const-variable -fobjc-arc
test.m:4:18: warning: unused variable 'kIntConstant' [-Wunused-const-variable]
static const int kIntConstant = 123;
                 ^
1 warning generated.
-- 
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/20170127/9eb18fad/attachment.html>
    
    
More information about the llvm-bugs
mailing list