+2005-05-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21681
+ * parser.c (cp_parser_late_parsing_for_member): Disable access
+ checking for template functions.
+
2005-05-26 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/21768
if (function_scope)
push_function_context_to (function_scope);
+
/* Push the body of the function onto the lexer stack. */
cp_parser_push_lexer_for_tokens (parser, tokens);
start_preparsed_function (member_function, NULL_TREE,
SF_PRE_PARSED | SF_INCLASS_INLINE);
+ /* Don't do access checking if it is a templated function. */
+ if (processing_template_decl)
+ push_deferring_access_checks (dk_no_check);
+
/* Now, parse the body of the function. */
cp_parser_function_definition_after_declarator (parser,
/*inline_p=*/true);
+ if (processing_template_decl)
+ pop_deferring_access_checks ();
+
/* Leave the scope of the containing function. */
if (function_scope)
pop_function_context_from (function_scope);
+2005-05-27 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/21681
+ * g++.dg/parse/template16.C: New.
+
2005-05-27 Andreas Jaeger <aj@suse.de>
* gcc.dg/setjmp-2.c: Only run in 32-bit.
--- /dev/null
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 26 May 2005 <nathan@codesourcery.com>
+
+// Origin:Volker Reichelt reichelt@gcc.gnu.org
+// PR 21681. ICE with inappropriate access check.
+
+template<int X> struct A;
+
+struct B
+{
+ template<int N> void foo()
+ {
+ A<N>::X::Y;
+ }
+};