https://llvm.org/bugs/show_bug.cgi?id=31046

            Bug ID: 31046
           Summary: NSDMI seems to disable unused variable warning
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: yaghmour.sha...@gmail.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
    Classification: Unclassified

Given the following code:

struct A1 {
  double x = 1; // NSDMI seems to disable the unused variable warning
};

struct A2 {
  double x ;  
};

void f() {
    A1 a1 ; // No unused variable warning
    A2 a2 ; // OK unused variable warning

}

int main(){}

and compiling using:

clang++ -std=c++11 -Wall 

I receive a warning for a2 being unused but not for a1:

warning: unused variable 'a2' [-Wunused-variable]
    A2 a2 ; // OK unused variable warning
       ^

It looks like the use of NSDMI disables this warning. Is this intended
behavior? It seems unexpected that simply using NSDMI would disable this
warning for a class.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to