Skip to content

access specifier ignored for destructor #9422

@llvmbot

Description

@llvmbot
Bugzilla Link 9050
Resolution FIXED
Resolved on Feb 01, 2011 09:53
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions