aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/cp/name-lookup.c
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2014-06-18 13:00:04 -0700
committerPavel Chupin <pavel.v.chupin@intel.com>2014-06-19 22:38:42 +0400
commitf190d6284359da8ae8694b2d2e14b01602a959ed (patch)
treed4e0548e7cec02d60b1082368032e66a1c509a02 /gcc-4.8/gcc/cp/name-lookup.c
parent4ff2f42147bc128ce38789071d98e55844cd3a5e (diff)
downloadtoolchain_gcc-f190d6284359da8ae8694b2d2e14b01602a959ed.tar.gz
toolchain_gcc-f190d6284359da8ae8694b2d2e14b01602a959ed.tar.bz2
toolchain_gcc-f190d6284359da8ae8694b2d2e14b01602a959ed.zip
Merge GCC 4.8.3
Change-Id: I0abe59f7705b3eccc6b2f123af75b2e30917696a
Diffstat (limited to 'gcc-4.8/gcc/cp/name-lookup.c')
-rw-r--r--gcc-4.8/gcc/cp/name-lookup.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc-4.8/gcc/cp/name-lookup.c b/gcc-4.8/gcc/cp/name-lookup.c
index c121a4163..da167ec41 100644
--- a/gcc-4.8/gcc/cp/name-lookup.c
+++ b/gcc-4.8/gcc/cp/name-lookup.c
@@ -394,7 +394,8 @@ pop_binding (tree id, tree decl)
}
}
-/* Strip non dependent using declarations. */
+/* Strip non dependent using declarations. If DECL is dependent,
+ surreptitiously create a typename_type and return it. */
tree
strip_using_decl (tree decl)
@@ -404,6 +405,23 @@ strip_using_decl (tree decl)
while (TREE_CODE (decl) == USING_DECL && !DECL_DEPENDENT_P (decl))
decl = USING_DECL_DECLS (decl);
+
+ if (TREE_CODE (decl) == USING_DECL && DECL_DEPENDENT_P (decl)
+ && USING_DECL_TYPENAME_P (decl))
+ {
+ /* We have found a type introduced by a using
+ declaration at class scope that refers to a dependent
+ type.
+
+ using typename :: [opt] nested-name-specifier unqualified-id ;
+ */
+ decl = make_typename_type (TREE_TYPE (decl),
+ DECL_NAME (decl),
+ typename_type, tf_error);
+ if (decl != error_mark_node)
+ decl = TYPE_NAME (decl);
+ }
+
return decl;
}
@@ -5605,9 +5623,9 @@ static tree
push_using_directive (tree used)
{
tree ret;
- timevar_start (TV_NAME_LOOKUP);
+ bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
ret = push_using_directive_1 (used);
- timevar_stop (TV_NAME_LOOKUP);
+ timevar_cond_stop (TV_NAME_LOOKUP, subtime);
return ret;
}