+2008-01-27 Jason Merrill <jason@redhat.com>
+
+ PR c++/27177
+ * class.c (build_base_path): Fix previous change.
+
+ PR c++/27177
+ * class.c (build_base_path): Don't mess with virtual access if
+ skip_evaluation.
+ * call.c (standard_conversion): Don't check whether source type
+ is complete.
+
+ PR c++/33959
+ * pt.c (tsubst_aggr_type): Make sure our context is complete.
+
2007-10-26 Jakub Jelinek <jakub@redhat.com>
PR c++/33744
that necessitates this conversion is ill-formed.
Therefore, we use DERIVED_FROM_P, and do not check
access or uniqueness. */
- && DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from))
- /* If FROM is not yet complete, then we must be parsing
- the body of a class. We know what's derived from
- what, but we can't actually perform a
- derived-to-base conversion. For example, in:
-
- struct D : public B {
- static const int i = sizeof((B*)(D*)0);
- };
-
- the D*-to-B* conversion is a reinterpret_cast, not a
- static_cast. */
- && COMPLETE_TYPE_P (TREE_TYPE (from)))
+ && DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from)))
{
from =
cp_build_qualified_type (TREE_TYPE (to),
/* Do we need to look in the vtable for the real offset? */
virtual_access = (v_binfo && fixed_type_p <= 0);
+ /* Don't bother with the calculations inside sizeof; they'll ICE if the
+ source type is incomplete and the pointer value doesn't matter. */
+ if (skip_evaluation)
+ return build_nop (build_pointer_type (target_type), expr);
+
/* Do we need to check for a null pointer? */
if (want_pointer && !nonnull)
{
up. */
context = TYPE_CONTEXT (t);
if (context)
- context = tsubst_aggr_type (context, args, complain,
- in_decl, /*entering_scope=*/1);
+ {
+ context = tsubst_aggr_type (context, args, complain,
+ in_decl, /*entering_scope=*/1);
+ /* If context is a nested class inside a class template,
+ it may still need to be instantiated (c++/33959). */
+ if (TYPE_P (context))
+ complete_type (context);
+ }
/* Then, figure out what arguments are appropriate for the
type we are trying to find. For example, given: