+2004-06-07 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/15337
+ * error.c (c_sizeof_or_alignof_type): Use more detailed error
+ message.
+
2004-06-06 Paolo Bonzini <bonzini@gnu.org>
* config.in: Regenerate.
else if (!COMPLETE_TYPE_P (type))
{
if (complain)
- error ("invalid application of `%s' to an incomplete type", op_name);
+ error ("invalid application of `%s' to incomplete type `%T' ",
+ op_name, type);
value = size_zero_node;
}
else
+2004-06-07 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/15766
+ * parser.c (cp_parser_iteration_statement): Fix typo in error
+ message.
+
+ PR c++/14777
+ * pt.c (tsubst_default_argument): Do not defer access checks
+ while substituting into the default argument.
+
+ PR c++/15554
+ * pt.c (tsubst_copy): Do not try to substitute for an enumeration
+ constant in a non-dependent context.
+
+ PR c++/15057
+ * except.c (build_throw): Ensure that temp_expr has been
+ initialized.
+
2004-06-06 Roger Sayle <roger@eyesopen.com>
* cp/cp-tree.h (lvalue_or_else): Add function prototype.
because it will only return false in cases where elided is true,
and therefore we don't need to work around the failure to
preevaluate. */
+ temp_expr = NULL_TREE;
stabilize_init (exp, &temp_expr);
if (elided)
expression = cp_parser_expression (parser);
finish_for_expr (expression, statement);
/* Look for the `)'. */
- cp_parser_require (parser, CPP_CLOSE_PAREN, "`;'");
-
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+
/* Parse the body of the for-statement. */
parser->in_iteration_statement_p = true;
cp_parser_already_scoped_statement (parser);
};
we must be careful to do name lookup in the scope of S<T>,
- rather than in the current class.
-
- ??? current_class_type affects a lot more than name lookup. This is
- very fragile. Fortunately, it will go away when we do 2-phase name
- binding properly. */
-
- /* FN is already the desired FUNCTION_DECL. */
+ rather than in the current class. */
push_access_scope (fn);
/* The default argument expression should not be considered to be
within the scope of FN. Since push_access_scope sets
current_function_decl, we must explicitly clear it here. */
current_function_decl = NULL_TREE;
+ push_deferring_access_checks(dk_no_deferred);
arg = tsubst_expr (arg, DECL_TI_ARGS (fn),
tf_error | tf_warning, NULL_TREE);
-
+ pop_deferring_access_checks();
+
pop_access_scope (fn);
/* Make sure the default argument is reasonable. */
enumerators. */
if (DECL_NAMESPACE_SCOPE_P (t))
return t;
+ /* If ARGS is NULL, then T is known to be non-dependent. */
+ if (args == NULL_TREE)
+ return t;
/* Unfortunately, we cannot just call lookup_name here.
Consider:
+2004-06-07 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/15337
+ * g++.dg/expr/sizeof3.C: New test.
+
+ PR c++/14777
+ * g++.dg/template/access14.C: New test.
+
+ PR c++/15554
+ * g++.dg/template/enum1.C: New test.
+
+ PR c++/15057
+ * g++.dg/eh/throw1.C: New test.
+
2004-06-07 David Ayers <d.ayers@inode.at>
Ziemowit Laski <zlaski@apple.com>
--- /dev/null
+class S
+{
+public:
+ S(){}
+};
+
+int foo(char* m1) {
+ throw (m1 ? S() : S());
+}
--- /dev/null
+// PR c++/15337
+
+class CCC;
+int main() { sizeof(CCC); return 0; } // { dg-error ".*CCC.*" }
--- /dev/null
+// PR c++/14777
+
+template <typename T>
+struct B
+{
+protected:
+ typedef int M;
+};
+
+template <typename T>
+struct A : B<T> {
+ typedef typename B<T>::M N;
+ A (int = N ());
+};
+
+A<int> a = A<int> ();
--- /dev/null
+// PR c++/15554
+
+template <int n> struct T1 { enum { N = 3 }; };
+template <int n> struct T2 { enum { N = 3, N1 = T1<N>::N }; };
+