aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r--gcc/cp/decl.c38
1 files changed, 8 insertions, 30 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index cb0f11f5749..c4731ae2416 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3480,9 +3480,9 @@ make_typename_type (tree context, tree name, enum tag_types tag_type,
if (TREE_CODE (name) == TEMPLATE_ID_EXPR)
{
name = TREE_OPERAND (name, 0);
- if (TREE_CODE (name) == TEMPLATE_DECL)
+ if (DECL_TYPE_TEMPLATE_P (name))
name = TREE_OPERAND (fullname, 0) = DECL_NAME (name);
- else if (TREE_CODE (name) == OVERLOAD)
+ if (TREE_CODE (name) != IDENTIFIER_NODE)
{
if (complain & tf_error)
error ("%qD is not a type", name);
@@ -6061,7 +6061,6 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
{
int toplev = toplevel_bindings_p ();
int defer_p;
- const char *filename;
/* Set the DECL_ASSEMBLER_NAME for the object. */
if (asmspec)
@@ -6109,32 +6108,9 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
DECL_EXPR is expanded. */
defer_p = DECL_FUNCTION_SCOPE_P (decl) || DECL_VIRTUAL_P (decl);
- /* We try to defer namespace-scope static constants so that they are
- not emitted into the object file unnecessarily. */
- filename = LOCATION_FILE (input_location);
- if (!DECL_VIRTUAL_P (decl)
- && TREE_READONLY (decl)
- && DECL_INITIAL (decl) != NULL_TREE
- && DECL_INITIAL (decl) != error_mark_node
- && filename != NULL
- && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))
- && toplev
- && !TREE_PUBLIC (decl))
- {
- /* Fool with the linkage of static consts according to #pragma
- interface. */
- struct c_fileinfo *finfo = get_fileinfo (filename);
- if (!finfo->interface_unknown && !TREE_PUBLIC (decl))
- {
- TREE_PUBLIC (decl) = 1;
- DECL_EXTERNAL (decl) = finfo->interface_only;
- }
-
- defer_p = 1;
- }
- /* Likewise for template instantiations. */
- else if (DECL_LANG_SPECIFIC (decl)
- && DECL_IMPLICIT_INSTANTIATION (decl))
+ /* Defer template instantiations. */
+ if (DECL_LANG_SPECIFIC (decl)
+ && DECL_IMPLICIT_INSTANTIATION (decl))
defer_p = 1;
/* If we're not deferring, go ahead and assemble the variable. */
@@ -8234,7 +8210,9 @@ grokvardecl (tree type,
DECL_INTERFACE_KNOWN (decl) = 1;
// Handle explicit specializations and instantiations of variable templates.
- if (orig_declarator)
+ if (orig_declarator
+ /* For GCC 5 fix 65646 this way. */
+ && current_tmpl_spec_kind (template_count) != tsk_none)
decl = check_explicit_specialization (orig_declarator, decl,
template_count, 0);