[LLVMbugs] [Bug 9785] Template friend in namespace doesn't work correctly.
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Oct 9 16:30:07 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=9785
Douglas Gregor <dgregor at apple.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
--- Comment #1 from Douglas Gregor <dgregor at apple.com> 2011-10-09 18:30:06 CDT ---
Clang is actually behaving correctly here. The friend struct template
declaration here:
namespace detail {
template <class T>
struct Info {
template <class X> friend struct Test;
protected:
Info(int) {}
};
}
actually makes the struct template "detail::Test" a friend, because friend
declarations refer to the innermost enclosing namespace.
The right way to do this would be:
template <class T> struct Test;
namespace detail {
template <class T>
struct Info {
template <class X> friend struct ::Test;
protected:
Info(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.
More information about the llvm-bugs
mailing list