#include <class.h>
Inheritance diagram for Class_lookup_helper:
Public Methods | |
virtual | ~Class_lookup_helper () |
void | add_class (Class_symbol *sym) |
Add a base class subobject to the result set. More... | |
void | finish (Class_symbol *sym) |
Finish up the result set. More... | |
Protected Types | |
typedef std::vector< Class_symbol * > | classes_t |
Protected Methods | |
virtual bool | predicate (Class_symbol *sym)=0 |
Class_lookup_helper () | |
Helper class to implement lookup of class members. More... | |
Protected Attributes | |
classes_t | result_set |
classes_t | hidden_vbcs |
|
|
|
|
|
Helper class to implement lookup of class members. 10.2: First, every declaration for the name in the class and in each of its base class sub-objects is considered. A member name f in one sub-object B hides a member name f in a sub-object A if A is a base class sub-object of B. Any declarations that are so hidden are eliminated from consideration. Each of these declarations that was introduced by a using-declaration is considered to be from each sub-object of C that is of the type containing the declara-tion designated by the using-declaration.96) If the resulting set of declarations are not all from sub-objects of the same type, or the set has a nonstatic member and includes members from distinct sub-objects, there is an ambiguity and the program is ill-formed. Otherwise that set is the result of the lookup. FIXME: g++ accepts the following: struct A { struct stat {}; }; struct B { static void stat(); }; struct C : A, B { }; struct C::stat x; and rejects void x() { C::stat(); } We currently reject both. |
|
Add a base class subobject to the result set.
Definition at line 536 of file class.cc. References Class_symbol::base_classes, hidden_vbcs, predicate(), result_set, and Class_symbol::virtual_base_classes. Referenced by Class_op_lookup_helper::is_visible_in(), and Class_scope::lookup_here(). |
|
Finish up the result set. This adds the non-hidden base classes to the set. Definition at line 561 of file class.cc. References hidden_vbcs, predicate(), result_set, and Class_symbol::virtual_base_classes. Referenced by Class_op_lookup_helper::is_visible_in(), and Class_scope::lookup_here(). |
|
Implemented in Class_name_lookup_helper, and Class_op_lookup_helper. |
|
|
|
Definition at line 146 of file class.h. Referenced by add_class(), finish(), Class_name_lookup_helper::get_result(), and Class_op_lookup_helper::is_visible_in(). |