diff options
author | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-22 03:55:51 +0000 |
---|---|---|
committer | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-22 03:55:51 +0000 |
commit | 694683bbcd14ccda5b40367fe2ad0f75d030db6e (patch) | |
tree | c508723a4bc62e4868f5b9b447ddc497eba95417 /gcc/cp/semantics.c | |
parent | c9704621e7f964d93a814201351120509f348485 (diff) | |
download | gcc-694683bbcd14ccda5b40367fe2ad0f75d030db6e.tar.gz |
* cp-tree.h (identifier_p): New.
* call.c: Throughout, call identifier_p insstead of direct
comparaison of TREE_CODE against IDENTIFIER_NODE.
* decl.c: Likewisse.
* decl2.c: Likewise.
* init.c: Likewise.
* mangle.c: Likewise.
* name-lookup.c: Likewise.
* parser.c: Likewise.
* pt.c: Likewise.
* search.c: Likewise.
* semantics.c: Likewise.
* tree.c: Likewise.
* typeck.c: Likewise.
* typeck2.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196897 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 3691d862049..e3aeb817a52 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -536,7 +536,7 @@ simplify_loop_decl_cond (tree *cond_p, tree body) tree finish_goto_stmt (tree destination) { - if (TREE_CODE (destination) == IDENTIFIER_NODE) + if (identifier_p (destination)) destination = lookup_label (destination); /* We warn about unused labels with -Wunused. That means we have to @@ -1999,7 +1999,7 @@ perform_koenig_lookup (tree fn, vec<tree, va_gc> *args, bool include_std, } /* Find the name of the overloaded function. */ - if (TREE_CODE (fn) == IDENTIFIER_NODE) + if (identifier_p (fn)) identifier = fn; else if (is_overloaded_fn (fn)) { @@ -2966,7 +2966,7 @@ finish_id_expression (tree id_expression, if (scope && (!TYPE_P (scope) || (!dependent_type_p (scope) - && !(TREE_CODE (id_expression) == IDENTIFIER_NODE + && !(identifier_p (id_expression) && IDENTIFIER_TYPENAME_P (id_expression) && dependent_type_p (TREE_TYPE (id_expression)))))) { @@ -2995,8 +2995,7 @@ finish_id_expression (tree id_expression, the current class so that we can check later to see if the meaning would have been different after the class was entirely defined. */ - if (!scope && decl != error_mark_node - && TREE_CODE (id_expression) == IDENTIFIER_NODE) + if (!scope && decl != error_mark_node && identifier_p (id_expression)) maybe_note_name_used_in_class (id_expression, decl); /* Disallow uses of local variables from containing functions, except @@ -3169,8 +3168,7 @@ finish_id_expression (tree id_expression, /* A template-id where the name of the template was not resolved is definitely dependent. */ else if (TREE_CODE (decl) == TEMPLATE_ID_EXPR - && (TREE_CODE (TREE_OPERAND (decl, 0)) - == IDENTIFIER_NODE)) + && (identifier_p (TREE_OPERAND (decl, 0)))) dependent_p = true; /* For anything except an overloaded function, just check its type. */ @@ -5301,7 +5299,7 @@ finish_decltype_type (tree expr, bool id_expression_or_member_access_p, [expr.ref]), decltype(e) is defined as the type of the entity named by e. If there is no such entity, or e names a set of overloaded functions, the program is ill-formed. */ - if (TREE_CODE (expr) == IDENTIFIER_NODE) + if (identifier_p (expr)) expr = lookup_name (expr); if (TREE_CODE (expr) == INDIRECT_REF) |