aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2013-04-01 17:33:27 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2013-04-01 17:33:27 +0000
commit5bc08e85f179b65b4e8f4bb70421216805c5c6bf (patch)
tree0d8d5bdf7ad8a0274141690de1839c4d8b042617
parent136fb3f734a18e6759988346b1c8d3e34e67d05a (diff)
downloadgcc-5bc08e85f179b65b4e8f4bb70421216805c5c6bf.zip
gcc-5bc08e85f179b65b4e8f4bb70421216805c5c6bf.tar.gz
gcc-5bc08e85f179b65b4e8f4bb70421216805c5c6bf.tar.bz2
cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
2013-04-01 Paolo Carlini <paolo.carlini@oracle.com> * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove. (DECL_FUNCTION_TEMPLATE_P): Adjust. * cxx-pretty-print.c (pp_cxx_nested_name_specifier, pp_cxx_qualified_id): Use get_containing_scope. * parser.c (cp_parser_class_head): Likewise. * pt.c (push_template_decl_real): Likewise. * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION. * pt.c (unify): Use CP_INTEGRAL_TYPE_P. From-SVN: r197309
-rw-r--r--gcc/cp/ChangeLog13
-rw-r--r--gcc/cp/cp-tree.h12
-rw-r--r--gcc/cp/cxx-pretty-print.c4
-rw-r--r--gcc/cp/decl2.c3
-rw-r--r--gcc/cp/parser.c4
-rw-r--r--gcc/cp/pt.c7
6 files changed, 23 insertions, 20 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index df25c09..f96c264 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,16 @@
+2013-04-01 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * cp-tree.h (DECL_UNBOUND_CLASS_TEMPLATE_P): Remove.
+ (DECL_FUNCTION_TEMPLATE_P): Adjust.
+
+ * cxx-pretty-print.c (pp_cxx_nested_name_specifier,
+ pp_cxx_qualified_id): Use get_containing_scope.
+ * parser.c (cp_parser_class_head): Likewise.
+ * pt.c (push_template_decl_real): Likewise.
+
+ * decl2.c (import_export_decl): Use DECL_TEMPLOID_INSTANTIATION.
+ * pt.c (unify): Use CP_INTEGRAL_TYPE_P.
+
2013-03-31 Paolo Carlini <paolo.carlini@oracle.com>
* decl2.c (collect_candidates_for_java_method_aliases): Use
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index eef60a2..3119105 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3730,14 +3730,10 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define DECL_TEMPLATE_TEMPLATE_PARM_P(NODE) \
(TREE_CODE (NODE) == TEMPLATE_DECL && DECL_TEMPLATE_PARM_P (NODE))
-/* Nonzero if NODE is a TEMPLATE_DECL representing an
- UNBOUND_CLASS_TEMPLATE tree node. */
-#define DECL_UNBOUND_CLASS_TEMPLATE_P(NODE) \
- (TREE_CODE (NODE) == TEMPLATE_DECL && !DECL_TEMPLATE_RESULT (NODE))
-
-#define DECL_FUNCTION_TEMPLATE_P(NODE) \
- (TREE_CODE (NODE) == TEMPLATE_DECL \
- && !DECL_UNBOUND_CLASS_TEMPLATE_P (NODE) \
+/* Nonzero for a DECL that represents a function template. */
+#define DECL_FUNCTION_TEMPLATE_P(NODE) \
+ (TREE_CODE (NODE) == TEMPLATE_DECL \
+ && DECL_TEMPLATE_RESULT (NODE) != NULL_TREE \
&& TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)
/* Nonzero for a DECL that represents a class template or alias
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index 0b707fb..ef8df70 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -260,7 +260,7 @@ pp_cxx_nested_name_specifier (cxx_pretty_printer *pp, tree t)
{
if (!SCOPE_FILE_SCOPE_P (t) && t != pp->enclosing_scope)
{
- tree scope = TYPE_P (t) ? TYPE_CONTEXT (t) : DECL_CONTEXT (t);
+ tree scope = get_containing_scope (t);
pp_cxx_nested_name_specifier (pp, scope);
pp_cxx_template_keyword_if_needed (pp, scope, t);
pp_cxx_unqualified_id (pp, t);
@@ -308,7 +308,7 @@ pp_cxx_qualified_id (cxx_pretty_printer *pp, tree t)
default:
{
- tree scope = TYPE_P (t) ? TYPE_CONTEXT (t) : DECL_CONTEXT (t);
+ tree scope = get_containing_scope (t);
if (scope != pp->enclosing_scope)
{
pp_cxx_nested_name_specifier (pp, scope);
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 2b21710..e14c388 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2572,8 +2572,7 @@ import_export_decl (tree decl)
else
comdat_p = true;
}
- else if (DECL_TEMPLATE_INSTANTIATION (decl)
- || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl))
+ else if (DECL_TEMPLOID_INSTANTIATION (decl))
{
/* DECL is an implicit instantiation of a function or static
data member. */
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 44ef9ad..a5cf66d 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -18773,9 +18773,7 @@ cp_parser_class_head (cp_parser* parser,
for (scope = TREE_TYPE (type);
scope && TREE_CODE (scope) != NAMESPACE_DECL;
- scope = (TYPE_P (scope)
- ? TYPE_CONTEXT (scope)
- : DECL_CONTEXT (scope)))
+ scope = get_containing_scope (scope))
if (TYPE_P (scope)
&& CLASS_TYPE_P (scope)
&& CLASSTYPE_TEMPLATE_INFO (scope)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 68da2c8..7f4212d 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -4803,9 +4803,7 @@ push_template_decl_real (tree decl, bool is_friend)
/* Can happen in erroneous input. */
break;
else
- current = (TYPE_P (current)
- ? TYPE_CONTEXT (current)
- : DECL_CONTEXT (current));
+ current = get_containing_scope (current);
}
/* Check that the parms are used in the appropriate qualifying scopes
@@ -16750,8 +16748,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
else if (same_type_p (TREE_TYPE (arg), tparm))
/* OK */;
else if ((strict & UNIFY_ALLOW_INTEGER)
- && (TREE_CODE (tparm) == INTEGER_TYPE
- || TREE_CODE (tparm) == BOOLEAN_TYPE))
+ && CP_INTEGRAL_TYPE_P (tparm))
/* Convert the ARG to the type of PARM; the deduced non-type
template argument must exactly match the types of the
corresponding parameter. */