This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 08/23/2012 10:04 AM, Paolo Carlini wrote:I tried, possibly together with a preliminary DECL_LANG_SPECIFIC check and maybe a check that decl isn't already error_mark_node, but anyway apparently the idea has issues with friends, testcases like template/friend17.C (gave me already headaches earlier today, that's why I'm so quick at replying ;)+ if (decl + && TREE_CODE (decl) == VAR_DECL + && ! TYPE_P (CP_DECL_CONTEXT (decl))) + { + error_at (decl_spec_token_start->location, + "%qT is not a template type", TREE_TYPE (decl)); + decl = error_mark_node; + }
Can we just check whether decl has DECL_TEMPLATE_INFO at this point?
template <class T> struct X { template <class U> void operator+=(U);
template <class V> template <class U> friend void X<V>::operator+=(U); };
int main() { X<int>() += 1.0; }
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |