http://llvm.org/bugs/show_bug.cgi?id=8368
Summary: Compiler getting confused when using templated
function from the return value of a function of a
member
Product: clang
Version: trunk
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
The following code fails to compile (see comments)
namespace bug
{
class A
{
public:
template<typename T> T foo(void) const;
};
class B
{
public:
A& get_A() const;
};
template<typename D>
class C
{
private:
B & m_b;
public:
C(B & b)
: m_b(b)
{
}
int bar(void)
{
return m_b.get_A().foo<int>();
// fails with:
// error: use 'template' keyword to treat 'foo' as a dependent template
name
// return m_b.get_A().foo<int>();
// ^
// template
// works with:
//A& a= m_b.get_A();
//return a.foo<int>();
}
};
}
--
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