[LLVMbugs] [Bug 20930] New: declspec/attribute deprecated does not give a warning for nested anonymous classes

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 12 15:25:05 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20930

            Bug ID: 20930
           Summary: declspec/attribute deprecated does not give a warning
                    for nested anonymous classes
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: sunil_srivastava at playstation.sony.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following example gives warnings 'is deprecated' for A[xy] and C[xy], 
but not for B[xy]. 

struct {
  __declspec(deprecated("deprecated A")) int Ax;
  int Ay __attribute((deprecated));

  struct { __declspec(deprecated("deprecated B")) int Bx; };
  struct { int By __attribute((deprecated)); };

  struct {
    __declspec(deprecated("deprecated C")) int Cx;
    int Cy __attribute((deprecated));
  } c;
} foo ;
void bar();
void bar() {
  foo.Ax = foo.Ay;
  foo.Bx = foo.By;
  foo.c.Cx = foo.c.Cy;
}

$ clang++ -Weverything -S -p.cpp
p.cpp:5:3: warning: anonymous structs are a GNU extension
[-Wgnu-anonymous-struct]
  struct { __declspec(deprecated("deprecated B")) int Bx; };
  ^
p.cpp:6:3: warning: anonymous structs are a GNU extension
[-Wgnu-anonymous-struct]
  struct { int By __attribute((deprecated)); };
  ^
p.cpp:15:7: warning: 'Ax' is deprecated: deprecated A
[-Wdeprecated-declarations]
  foo.Ax = foo.Ay;
      ^
p.cpp:2:46: note: 'Ax' has been explicitly marked deprecated here
  __declspec(deprecated("deprecated A")) int Ax;
                                             ^
p.cpp:15:16: warning: 'Ay' is deprecated [-Wdeprecated-declarations]
  foo.Ax = foo.Ay;
               ^
p.cpp:3:7: note: 'Ay' has been explicitly marked deprecated here
  int Ay __attribute((deprecated));
      ^
p.cpp:17:9: warning: 'Cx' is deprecated: deprecated C
[-Wdeprecated-declarations]
  foo.c.Cx = foo.c.Cy;
        ^
p.cpp:9:48: note: 'Cx' has been explicitly marked deprecated here
    __declspec(deprecated("deprecated C")) int Cx;
                                               ^
p.cpp:17:20: warning: 'Cy' is deprecated [-Wdeprecated-declarations]
  foo.c.Cx = foo.c.Cy;
                   ^
p.cpp:10:9: note: 'Cy' has been explicitly marked deprecated here
    int Cy __attribute((deprecated));
        ^
6 warnings generated.
$


This is in TOT as of svn r217698.

-- 
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/20140912/ac11f1b1/attachment.html>


More information about the llvm-bugs mailing list