* decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
* error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
* typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
* class.c (instantiate_type): Check unknown_type_node rather than
UNKNOWN_TYPE.
* name-lookup.c (maybe_push_decl): Likewise.
* rtti.c (get_tinfo_decl_dynamic): Likewise.
(get_typeid): Likewise.
* semantics.c (finish_offsetof): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159349
138bc75d-0d04-0410-961f-
82ee72b054a4
2010-05-12 Jason Merrill <jason@redhat.com>
+ * cp-tree.h (UNKNOWN_TYPE): Remove.
+ * decl.c (cxx_init_decl_processing): Use LANG_TYPE instead.
+ * error.c (dumy_type, dump_type_prefix, dump_type_suffix): Likewise.
+ * typeck2.c (cxx_incomplete_type_diagnostic): Likewise.
+ * class.c (instantiate_type): Check unknown_type_node rather than
+ UNKNOWN_TYPE.
+ * name-lookup.c (maybe_push_decl): Likewise.
+ * rtti.c (get_tinfo_decl_dynamic): Likewise.
+ (get_typeid): Likewise.
+ * semantics.c (finish_offsetof): Likewise.
+
PR c++/20669
* call.c (add_template_candidate_real): If deduction fails, still
add the template as a non-viable candidate.
#define ANON_UNION_TYPE_P(NODE) \
(TREE_CODE (NODE) == UNION_TYPE && ANON_AGGR_TYPE_P (NODE))
-#define UNKNOWN_TYPE LANG_TYPE
-
/* Define fields and accessors for nodes representing declared names. */
#define TYPE_WAS_ANONYMOUS(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->was_anonymous)
/* C++ extensions */
- unknown_type_node = make_node (UNKNOWN_TYPE);
+ unknown_type_node = make_node (LANG_TYPE);
record_unknown_type (unknown_type_node, "unknown type");
/* Indirecting an UNKNOWN_TYPE node yields an UNKNOWN_TYPE node. */
TYPE_POINTER_TO (unknown_type_node) = unknown_type_node;
TYPE_REFERENCE_TO (unknown_type_node) = unknown_type_node;
- init_list_type_node = make_node (UNKNOWN_TYPE);
+ init_list_type_node = make_node (LANG_TYPE);
record_unknown_type (init_list_type_node, "init list");
{
/* Call-backs for C++ error reporting.
This code is non-reentrant.
- Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003,
- 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
+ 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
#include "tm.h"
#include "tree.h"
#include "cp-tree.h"
+#include "real.h"
#include "toplev.h"
#include "flags.h"
#include "diagnostic.h"
-#include "tree-diagnostic.h"
#include "langhooks-def.h"
#include "intl.h"
#include "cxx-pretty-print.h"
-#include "tree-pretty-print.h"
#include "pointer-set.h"
#define pp_separate_with_comma(PP) pp_cxx_separate_with (PP, ',')
else if (t == unknown_type_node)
pp_string (cxx_pp, M_("<unresolved overloaded function type>"));
else
- {
- pp_cxx_cv_qualifier_seq (cxx_pp, t);
- pp_cxx_tree_identifier (cxx_pp, TYPE_IDENTIFIER (t));
- }
+ gcc_unreachable ();
break;
case TREE_LIST:
{
const char *old_prefix = context->printer->prefix;
const char *file = LOCATION_FILE (diagnostic->location);
- tree abstract_origin = diagnostic_abstract_origin (diagnostic);
+ tree abstract_origin = diagnostic->abstract_origin;
char *new_prefix = (file && abstract_origin == NULL)
? file_name_as_prefix (file) : NULL;
case 'T': result = type_to_string (next_tree, verbose); break;
case 'V': result = cv_to_string (next_tree, verbose); break;
- case 'K':
- percent_K_format (text);
- return true;
-
default:
return false;
}
type = TYPE_MAIN_VARIANT (type);
/* For UNKNOWN_TYPEs call complete_type_or_else to get diagnostics. */
- if (CLASS_TYPE_P (type) || TREE_CODE (type) == UNKNOWN_TYPE)
+ if (CLASS_TYPE_P (type) || type == unknown_type_node
+ || type == init_list_type_node)
type = complete_type_or_else (type, exp);
if (!type)
type = TYPE_MAIN_VARIANT (type);
/* For UNKNOWN_TYPEs call complete_type_or_else to get diagnostics. */
- if (CLASS_TYPE_P (type) || TREE_CODE (type) == UNKNOWN_TYPE)
+ if (CLASS_TYPE_P (type) || type == unknown_type_node
+ || type == init_list_type_node)
type = complete_type_or_else (type, NULL_TREE);
if (!type)
}
if (TREE_CODE (TREE_TYPE (expr)) == FUNCTION_TYPE
|| TREE_CODE (TREE_TYPE (expr)) == METHOD_TYPE
- || TREE_CODE (TREE_TYPE (expr)) == UNKNOWN_TYPE)
+ || TREE_TYPE (expr) == unknown_type_node)
{
if (TREE_CODE (expr) == COMPONENT_REF
|| TREE_CODE (expr) == COMPOUND_EXPR)