[LLVMbugs] [Bug 8791] New: Presence of friend member functions should be checked at template instantiation time
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Dec 14 15:44:29 PST 2010
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: unassignedclangbugs at nondot.org
ReportedBy: nicolasweber at gmx.de
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
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.
More information about the llvm-bugs
mailing list