http://llvm.org/bugs/show_bug.cgi?id=9476
Summary: clang++ asserts while parsing broken/strange top level
declaration
Product: clang
Version: trunk
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
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 <typename T>
static int
fcn()
{
return sizeof(T);
}
template <typename T>
struct A {};
template <int I>
struct B : A<B<I> > {};
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.
--
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs