+2003-09-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12167
+ * parser.c (cp_parser_late_parsing_default_args): Push & pop the
+ unparsed functions queue.
+
2003-09-05 Mark Mitchell <mark@codesourcery.com>
PR c++/12163
bool saved_local_variables_forbidden_p;
tree parameters;
+ /* While we're parsing the default args, we might (due to the
+ statement expression extension) encounter more classes. We want
+ to handle them right away, but we don't want them getting mixed
+ up with default args that are currently in the queue. */
+ parser->unparsed_functions_queues
+ = tree_cons (NULL_TREE, NULL_TREE, parser->unparsed_functions_queues);
+
for (parameters = TYPE_ARG_TYPES (TREE_TYPE (fn));
parameters;
parameters = TREE_CHAIN (parameters))
parser->lexer = saved_lexer;
parser->local_variables_forbidden_p = saved_local_variables_forbidden_p;
}
+
+ /* Restore the queue. */
+ parser->unparsed_functions_queues
+ = TREE_CHAIN (parser->unparsed_functions_queues);
}
/* Parse the operand of `sizeof' (or a similar operator). Returns
+2003-09-06 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12167
+ * g++.dg/parse/defarg5.C: New test.
+
+ * g++.dg/template/non-type-template-argument-1.C: Tweak expected error.
+
2003-09-05 Mark Mitchell <mark@codesourcery.com>
PR c++/12163
--- /dev/null
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Sep 2003 <nathan@codesourcery.com>
+// Origin:Wolfgang Bangerth bangerth@dealii.org
+
+// PR c++/12167 - infinite recursion
+
+class A {
+ void report(int d
+ // the default arg is what NAN etc can expand to, but
+ // with the floatiness removed.
+ = (__extension__ ((union { unsigned l; int d; })
+ { l: 0x7fc00000U }).d));
+};
template <typename T> struct D
{
- C<T::X> c; // { dg-error "invalid use" }
+ C<T::X> c; // { dg-error "names a type" }
};
D<B> d; // { dg-error "" }