* error.c (dump_parameters): Mask out TFF_SCOPE.
(dump_simple_decl): Don't print the scope of a PARM_DECL.
(dump_scope): Remove no-op mask.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160420
138bc75d-0d04-0410-961f-
82ee72b054a4
2010-06-07 Jason Merrill <jason@redhat.com>
+ PR c++/44366
+ * error.c (dump_parameters): Mask out TFF_SCOPE.
+ (dump_simple_decl): Don't print the scope of a PARM_DECL.
+ (dump_scope): Remove no-op mask.
+
PR c++/44401
* parser.c (cp_parser_lookup_name): Fix naming the constructor.
static void
dump_scope (tree scope, int flags)
{
- int f = ~TFF_RETURN_TYPE & (flags & (TFF_SCOPE | TFF_CHASE_TYPEDEF));
+ int f = flags & (TFF_SCOPE | TFF_CHASE_TYPEDEF);
if (scope == NULL_TREE)
return;
pp_maybe_space (cxx_pp);
}
if (! (flags & TFF_UNQUALIFIED_NAME)
+ && TREE_CODE (t) != PARM_DECL
&& (!DECL_INITIAL (t)
|| TREE_CODE (DECL_INITIAL (t)) != TEMPLATE_PARM_INDEX))
dump_scope (CP_DECL_CONTEXT (t), flags);
dump_parameters (tree parmtypes, int flags)
{
int first = 1;
+ flags &= ~TFF_SCOPE;
pp_cxx_left_paren (cxx_pp);
for (first = 1; parmtypes != void_list_node;
+2010-06-07 Jason Merrill <jason@redhat.com>
+
+ PR c++/44366
+ * g++.dg/cpp0x/decltype23.C: New.
+
2010-06-08 Andrew Pinski <pinskia@gmail.com>
Shujing Zhao <pearly.zhao@oracle.com>
--- /dev/null
+// PR c++/44366
+// While printing the operand of decltype We were trying to print f as the
+// scope of t, causing infinite recursion.
+// { dg-options "-std=c++0x" }
+
+template <typename T>
+void f(T t, decltype(*t))
+{
+ struct A { void g() {
+ foo; // { dg-error "foo" }
+ } };
+}