Skip to content

No namespace awareness of static template fields #8456

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 8084
Resolution FIXED
Resolved on Sep 12, 2010 00:25
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@efriedma-quic

Extended Description

cat foo.cxx
namespace F {
template struct Foo {
static A *field;
};
}

using namespace F;
struct Bar : Foo {};
template <> Bar* Foo::field = 0;

clang++ -fsyntax-only foo.cxx
foo.cxx:9:28: error: static data member specialization of 'field' must originally be declared in namespace 'F'
template <> Bar* Foo::field = 0;
^
foo.cxx:3:19: note: explicitly specialized declaration is here
static A *field;

================================================================
system: Linux 2.6.32-24-generic amd64 Ubuntu 10.04
clang version 2.8 (trunk 113084)
Target: x86_64-unknown-linux-gnu
Thread model: posix

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