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

            Bug ID: 15240
           Summary: duplicate warning about deprecated destructor
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

This code:

struct B {
  ~B() __attribute__((deprecated));
};

struct X : public B { };

void test() {
  X *x = new X;
  delete x;
}

produces:

$ clang y.cc
y.cc:5:8: warning: '~B' is deprecated [-Wdeprecated-declarations]
struct X : public B { };
       ^
y.cc:2:3: note: '~B' declared here
  ~B() __attribute__((deprecated));
  ^
y.cc:5:8: warning: '~B' is deprecated [-Wdeprecated-declarations]
struct X : public B { };
       ^
y.cc:2:3: note: '~B' declared here
  ~B() __attribute__((deprecated));
  ^
2 warnings generated.

The issue is that the diagnostic is emitted from
MarkBaseAndMemberDestructorsReferenced, which is called twice, once from
SetCtorInitializers and once from DefineImplicitDestructor.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to