[LLVMbugs] [Bug 7725] New: [c++] clang++ throws compile error on possible C++ template 2 level namespace lookup
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Jul 27 12:44:33 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=7725
Summary: [c++] clang++ throws compile error on possible C++
template 2 level namespace lookup
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: mike.jackson at bluequartz.net
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
// BEGIN CODE
//
-----------------------------------------------------------------------------
class TestClass
{
public:
void PrintSelf() {std::cout << "TestClass.PrintSelf()" << std::endl;}
};
//
-----------------------------------------------------------------------------
template<class ignored>
class TypedefProvider : public TestClass
{
public:
typedef TestClass Test;
};
//
-----------------------------------------------------------------------------
template<typename T>
class TemplateClass : public TypedefProvider< T >
{
public:
void PrintSelf();
};
//
-----------------------------------------------------------------------------
template<typename T>
void TemplateClass<T>::PrintSelf()
{
this->TemplateClass<T>::Test::PrintSelf(); // ERROR
}
//
-----------------------------------------------------------------------------
int main ()
{
TemplateClass<int> c;
c.PrintSelf();
return 0;
}
// END CODE
This code compiles cleanly with GCC and Visual Studio 2008 but does not under
clang++.
620:[mjackson at ferb:clang]$ clang++ --version
clang version 2.8 (trunk 109532)
Target: i386-apple-darwin9
Thread model: posix
Clang and LLVM compiled on OS X 10.5.8 using Xcode tools 3.1.4.
Thanks
Mike Jackson
--
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.
More information about the llvm-bugs
mailing list