Closed
Description
Bugzilla Link | 9476 |
Resolution | FIXED |
Resolved on | Oct 09, 2011 18:02 |
Version | trunk |
OS | MacOS X |
CC | @DougGregor |
Extended Description
The following code should not compile, "fcn<B<0> >()" is not in a function block; it, however, does make clang assert.
$ cat clangbug2.cc
template
static int
fcn()
{
return sizeof(T);
}
template
struct A {};
template
struct B : A<B > {};
fcn<B<0> >();
$ clang++ --version
clang version 3.0 (trunk 127564)
Target: x86_64-apple-darwin10
Thread model: posix
$ clang++ clangbug2.cc -c
clangbug2.cc:14:1: error: C++ requires a type specifier for all declarations
fcn<B<0> >();
^~~
clangbug2.cc:14:1: error: template specialization requires 'template<>'
fcn<B<0> >();
^ ~~~~~~~
template<>
Assertion failed: (Linkage(CachedLinkage) == getLVForDecl(this, LVFlags::CreateOnlyDeclLinkage()).linkage()), function getLinkage, file Decl.cpp, line 652.