Skip to content

encapsulation and friend functions #9475

@llvmbot

Description

@llvmbot
Bugzilla Link 9103
Resolution FIXED
Resolved on Oct 09, 2011 17:38
Version 2.8
OS Linux
Reporter LLVM Bugzilla Contributor
CC @DougGregor

Extended Description

this code does not compile with clang++, although it does with g++, icc and comeau's online compiler:

struct base
{
protected:
static void foo(void) {}
};

struct cls: base
{
friend void bar(void)
{
base::foo();
}
};

clang++ complains with:
x.cpp:11:15: error: 'foo' is a protected member of 'base'
base::foo();
^
x.cpp:4:17: note: declared protected here
static void foo(void) {}
^
1 error generated.

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