aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/cp-tree.h
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2001-09-24 00:27:33 +0000
committerZack Weinberg <zack@gcc.gnu.org>2001-09-24 00:27:33 +0000
commit749ced524c4a4bcb7e8374854cc380e33e69a1d8 (patch)
tree1f1e9f3af7240cf9b105d13f1eb384eafd666ecf /gcc/cp/cp-tree.h
parent7a80cf9a2f287793e0361af57606031a17e636d4 (diff)
downloadgcc-749ced524c4a4bcb7e8374854cc380e33e69a1d8.zip
gcc-749ced524c4a4bcb7e8374854cc380e33e69a1d8.tar.gz
gcc-749ced524c4a4bcb7e8374854cc380e33e69a1d8.tar.bz2
top level:
* errors.h (warning, error, fatal, internal_error): Don't mark with ATTRIBUTE_PRINTF_n. * toplev.h (internal_error, fatal_io_error, warning, error, pedwarn, pedwarn_with_file_and_line, warning_with_file_and_line, error_with_file_and_line, sorry, error_for_asm, warning_for_asm): Likewise. cp: * Make-lang.in (CXX_OBJS): Take out cp/errfn.o. (cp/errfn.o): Delete rule. (cp/error.o): Depend on flags.h. * errfn.c: Delete file. * cp-tree.h: Declare warn_deprecated. Remove definitions of TFF_NAMESPACE_SCOPE, TFF_CLASS_SCOPE, TFF_CHASE_NAMESPACE_ALIAS, and TFF_TEMPLATE_DEFAULT_ARGUMENTS. #define cp_error, cp_warning, cp_pedwarn, and cp_compiler_error to error, warning, pedwarn, and internal_error respectively. Make cp_deprecated into a macro. Don't define cp_printer typedef or declare cp_printers. * error.c: Include flags.h. Delete: struct tree_formatting_info, print_function_argument_list, print_declaration, print_expression, print_function_declaration, print_function_parameter, print_type_id, print_cv_qualifier_seq, print_type_specifier_seq, print_simple_type_specifier, print_elaborated_type_specifier, print_rest_of_abstract_declarator, print_parameter_declaration_clause, print_exception_specification, print_nested_name_specifier, and definition of cp_printers. (locate_error): New function. (cp_error_at, cp_warning_at, cp_pedwarn_at): Moved here and rewritten in terms of locate_error and diagnostic.c. (cp_tree_printer): Rename cp_printer; wire up to *_to_string instead of deleted print_* routines. Handle %C, %L, %O, %Q also. (init_error): Adjust to match. po: * POTFILES.in: Remove cp/errfn.c. From-SVN: r45765
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r--gcc/cp/cp-tree.h71
1 files changed, 33 insertions, 38 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 525750d..de58ee4 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -997,6 +997,10 @@ extern int warn_old_style_cast;
extern int warn_reorder;
+/* Non-zero means warn about deprecated features. */
+
+extern int warn_deprecated;
+
/* Nonzero means to treat bitfields as unsigned unless they say `signed'. */
extern int flag_signed_bitfields;
@@ -3433,11 +3437,7 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
/* These constants can used as bit flags in the process of tree formatting.
TFF_PLAIN_IDENTIFIER: unqualified part of a name.
- TFF_NAMESPACE_SCOPE: the complete qualified-id form of a name.
- TFF_CLASS_SCOPE: if possible, include the class-name part of a
- qualified-id. This flag may be implied in some circumstances by
- TFF_NAMESPACE_SCOPE.
- TFF_SCOPE: the combination of the two above.
+ TFF_SCOPE: include the class and namespace scope of the name.
TFF_CHASE_TYPEDEF: print the original type-id instead of the typedef-name.
TFF_DECL_SPECIFIERS: print decl-specifiers.
TFF_CLASS_KEY_OR_ENUM: precede a class-type name (resp. enum name) with
@@ -3447,25 +3447,20 @@ enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
TFF_EXCEPTION_SPECIFICATION: show function exception specification.
TFF_TEMPLATE_HEADER: show the template<...> header in a
template-declaration.
- TFF_TEMPLATE_DEFAULT_ARGUMENTS: show template parameter default values.
TFF_TEMPLATE_NAME: show only template-name.
TFF_EXPR_IN_PARENS: Parenthesize expressions. */
#define TFF_PLAIN_IDENTIFIER (0)
-#define TFF_NAMESPACE_SCOPE (1)
-#define TFF_CLASS_SCOPE (1 << 1)
-#define TFF_CHASE_NAMESPACE_ALIAS (1 << 2)
-#define TFF_CHASE_TYPEDEF (1 << 3)
-#define TFF_DECL_SPECIFIERS (1 << 4)
-#define TFF_CLASS_KEY_OR_ENUM (1 << 5)
-#define TFF_RETURN_TYPE (1 << 6)
-#define TFF_FUNCTION_DEFAULT_ARGUMENTS (1 << 7)
-#define TFF_EXCEPTION_SPECIFICATION (1 << 8)
-#define TFF_TEMPLATE_HEADER (1 << 9)
-#define TFF_TEMPLATE_DEFAULT_ARGUMENTS (1 << 10)
-#define TFF_TEMPLATE_NAME (1 << 11)
-#define TFF_EXPR_IN_PARENS (1 << 12)
-#define TFF_SCOPE (TFF_NAMESPACE_SCOPE | TFF_CLASS_SCOPE)
+#define TFF_SCOPE (1)
+#define TFF_CHASE_TYPEDEF (1 << 1)
+#define TFF_DECL_SPECIFIERS (1 << 2)
+#define TFF_CLASS_KEY_OR_ENUM (1 << 3)
+#define TFF_RETURN_TYPE (1 << 4)
+#define TFF_FUNCTION_DEFAULT_ARGUMENTS (1 << 5)
+#define TFF_EXCEPTION_SPECIFICATION (1 << 6)
+#define TFF_TEMPLATE_HEADER (1 << 7)
+#define TFF_TEMPLATE_NAME (1 << 8)
+#define TFF_EXPR_IN_PARENS (1 << 9)
/* Returns the TEMPLATE_DECL associated to a TEMPLATE_TEMPLATE_PARM
node. */
@@ -3779,17 +3774,24 @@ extern tree set_guard PARAMS ((tree));
/* in parse.y */
extern void cp_parse_init PARAMS ((void));
-/* in errfn.c */
-/* The cp_* functions aren't suitable for ATTRIBUTE_PRINTF. */
-extern void cp_error PARAMS ((const char *, ...));
-extern void cp_error_at PARAMS ((const char *, ...));
-extern void cp_warning PARAMS ((const char *, ...));
-extern void cp_warning_at PARAMS ((const char *, ...));
-extern void cp_pedwarn PARAMS ((const char *, ...));
-extern void cp_pedwarn_at PARAMS ((const char *, ...));
-extern void cp_compiler_error PARAMS ((const char *, ...));
-extern void cp_sprintf PARAMS ((const char *, ...));
-extern void cp_deprecated PARAMS ((const char*));
+/* Obsolete names, formerly found in errfn.c, which no longer exists.
+ These are all variadic functions and therefore cannot be defined
+ as function-like macros. */
+#define cp_error error
+#define cp_warning warning
+#define cp_pedwarn pedwarn
+#define cp_compiler_error internal_error
+
+extern void cp_error_at PARAMS ((const char *msgid, ...));
+extern void cp_warning_at PARAMS ((const char *msgid, ...));
+extern void cp_pedwarn_at PARAMS ((const char *msgid, ...));
+
+/* XXX Not i18n clean. */
+#define cp_deprecated(str) \
+ do { if (warn_deprecated) \
+ cp_warning("%s is deprecated, please see the documentation for details", \
+ str); \
+ } while (0)
/* in error.c */
extern void init_error PARAMS ((void));
@@ -3802,13 +3804,6 @@ extern const char *cp_file_of PARAMS ((tree));
extern int cp_line_of PARAMS ((tree));
extern const char *language_to_string PARAMS ((enum languages, int));
extern void print_instantiation_context PARAMS ((void));
-/* cp_printer is the type of a function which converts an argument into
- a string for digestion by printf. The cp_printer function should deal
- with all memory management; the functions in errfn will not free
- the char*s returned. See error.c for an example use of this code. */
-typedef const char *cp_printer PARAMS ((tree, int));
-extern cp_printer *cp_printers[256];
-
/* in except.c */
extern void init_exception_processing PARAMS ((void));