[LLVMbugs] [Bug 9050] New: access specifier ignored for destructor

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jan 25 06:49:05 PST 2011


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

           Summary: access specifier ignored for destructor
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: adl at gnu.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


clang version 2.9 (trunk 123315)
Target: i386-pc-linux-gnu



% cat test.cc
class a
{
public:
  void killme() const
  {
    delete this;
  }
protected:
  ~a()
  {
  }
};


int main()
{
  const a* x = new a;
  delete x;
}
% clang++ -Wall -W test.cc
%

clang++ seems to ignore that "protected:" specifier.

Here is the output from g++, for comparison:

% g++ -Wall -W test.cc
test.cc: In function ‘int main()’:
test.cc:10: error: ‘a::~a()’ is protected
test.cc:19: error: within this context

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list