http://llvm.org/bugs/show_bug.cgi?id=8791
Summary: Presence of friend member functions should be checked
at template instantiation time
Product: clang
Version: trunk
Platform: PC
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
gcc does this, and it allows gcc to give a better diagnostic than clang:
hummer:src thakis$ cat test2.cc
template<class T>
class C {
friend void T::f();
};
class A {
};
void f() {
C<A> c;
A a;
a.f();
}
hummer:src thakis$ gcc -c test2.cc
test2.cc: In instantiation of ‘C<A>’:
test2.cc:10: instantiated from here
test2.cc:3: error: no ‘void A::f()’ member function declared in class ‘A’
hummer:src thakis$ ~/src/llvm-svn/Release/bin/clang -c test2.cc
test2.cc:12:5: error: no member named 'f' in 'A'
a.f();
~ ^
1 error generated.
--
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