diff options
author | Rong Xu <xur@google.com> | 2014-09-02 15:29:57 -0700 |
---|---|---|
committer | Rong Xu <xur@google.com> | 2014-09-02 15:29:57 -0700 |
commit | e97c99f15937e5762a973b25192aab824126a6d3 (patch) | |
tree | 7f0be3ff7c7d976af06887dc50accd68f7630a7f /gcc-4.9/gcc/cp/class.c | |
parent | f1c18afafc2b321465ae6b07ede127095942d7dc (diff) | |
download | toolchain_gcc-e97c99f15937e5762a973b25192aab824126a6d3.tar.gz toolchain_gcc-e97c99f15937e5762a973b25192aab824126a6d3.tar.bz2 toolchain_gcc-e97c99f15937e5762a973b25192aab824126a6d3.zip |
[gcc-4.9] Merge svn r214745 from google/gcc-4_9 branch.
Merge gcc-4_9 source r214745 from google/gcc-4_9 branch.
Change-Id: Ie6fa0fd72f4b4eec3adc4db4bb922e652d1c2605
Diffstat (limited to 'gcc-4.9/gcc/cp/class.c')
-rw-r--r-- | gcc-4.9/gcc/cp/class.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/cp/class.c b/gcc-4.9/gcc/cp/class.c index 265afc486..711a567cb 100644 --- a/gcc-4.9/gcc/cp/class.c +++ b/gcc-4.9/gcc/cp/class.c @@ -7251,6 +7251,29 @@ currently_open_derived_class (tree t) return NULL_TREE; } +/* Return the outermost enclosing class type that is still open, or + NULL_TREE. */ + +tree +outermost_open_class (void) +{ + if (!current_class_type) + return NULL_TREE; + tree r = NULL_TREE; + if (TYPE_BEING_DEFINED (current_class_type)) + r = current_class_type; + for (int i = current_class_depth - 1; i > 0; --i) + { + if (current_class_stack[i].hidden) + break; + tree t = current_class_stack[i].type; + if (!TYPE_BEING_DEFINED (t)) + break; + r = t; + } + return r; +} + /* Returns the innermost class type which is not a lambda closure type. */ tree |