diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-23 20:28:26 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-23 20:28:26 +0000 |
commit | 1fb8fb567e1d783d7e55ed80d673968e33aa8699 (patch) | |
tree | 6530c82a3bb6524b265d975b0455ba9de9f3d1af /gcc/cp/cp-tree.h | |
parent | c54654b756743468792089321b0fac9527cc11d8 (diff) | |
download | gcc-1fb8fb567e1d783d7e55ed80d673968e33aa8699.tar.gz |
PR c++/28025
* cp-tree.h (LOOKUP_HIDDEN): New macro. Reformat comments.
* name-lookup.c (unqualified_namespace_lookup): There is no way to
have a hidden name in non-namespace scopes.
* pt.c (tsubst_friend_class): Look for hidden names.
* decl.c (lookup_and_check_tag): Fix typo in comment.
* semantics.c (finish_compound_literal): Fix typo in comment.
PR c++/28025
* g++.dg/template/friend45.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115687 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 59 |
1 files changed, 32 insertions, 27 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 20e704cc2f3..e02d3d7b5bb 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -3380,46 +3380,51 @@ extern GTY(()) tree static_dtors; enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; -/* These are uses as bits in flags passed to build_new_method_call - to control its error reporting behavior. - - LOOKUP_PROTECT means flag access violations. - LOOKUP_COMPLAIN mean complain if no suitable member function - matching the arguments is found. - LOOKUP_NORMAL is just a combination of these two. - LOOKUP_NONVIRTUAL means make a direct call to the member function found - LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried. - DIRECT_BIND means that if a temporary is created, it should be created so - that it lives as long as the current variable bindings; otherwise it - only lives until the end of the complete-expression. It also forces - direct-initialization in cases where other parts of the compiler have - already generated a temporary, such as reference initialization and the - catch parameter. - LOOKUP_NO_CONVERSION means that user-defined conversions are not - permitted. Built-in conversions are permitted. - LOOKUP_DESTRUCTOR means explicit call to destructor. - LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references. - - These are used in global lookup to support elaborated types and - qualifiers. - - LOOKUP_PREFER_TYPES means not to accept objects, and possibly namespaces. - LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types. - LOOKUP_PREFER_BOTH means class-or-namespace-name. */ - +/* These are uses as bits in flags passed to various functions to + control their behavior. Despite the LOOKUP_ prefix, many of these + do not control name lookup. ??? Functions using these flags should + probably be modified to accept explicit boolean flags for the + behaviors relevant to them. */ +/* Check for access violations. */ #define LOOKUP_PROTECT (1 << 0) +/* Complain if no suitable member function matching the arguments is + found. */ #define LOOKUP_COMPLAIN (1 << 1) #define LOOKUP_NORMAL (LOOKUP_PROTECT | LOOKUP_COMPLAIN) +/* Even if the function found by lookup is a virtual function, it + should be called directly. */ #define LOOKUP_NONVIRTUAL (1 << 2) +/* Non-converting (i.e., "explicit") constructors are not tried. */ #define LOOKUP_ONLYCONVERTING (1 << 3) +/* If a temporary is created, it should be created so that it lives + as long as the current variable bindings; otherwise it only lives + until the end of the complete-expression. It also forces + direct-initialization in cases where other parts of the compiler + have already generated a temporary, such as reference + initialization and the catch parameter. */ #define DIRECT_BIND (1 << 4) +/* User-defined conversions are not permitted. (Built-in conversions + are permitted.) */ #define LOOKUP_NO_CONVERSION (1 << 5) +/* The user has explicitly called a destructor. (Therefore, we do + not need to check that the object is non-NULL before calling the + destructor.) */ #define LOOKUP_DESTRUCTOR (1 << 6) +/* Do not permit references to bind to temporaries. */ #define LOOKUP_NO_TEMP_BIND (1 << 7) +/* Do not accept objects, and possibly namespaces. */ #define LOOKUP_PREFER_TYPES (1 << 8) +/* Do not accept objects, and possibly types. */ #define LOOKUP_PREFER_NAMESPACES (1 << 9) +/* Accept types or namespaces. */ #define LOOKUP_PREFER_BOTH (LOOKUP_PREFER_TYPES | LOOKUP_PREFER_NAMESPACES) +/* We are checking that a constructor can be called -- but we do not + actually plan to call it. */ #define LOOKUP_CONSTRUCTOR_CALLABLE (1 << 10) +/* Return friend decarations and un-declared builtin functions. + (Normally, these entities are registered in the symbol table, but + not found by lookup.) */ +#define LOOKUP_HIDDEN (LOOKUP_CONSTRUCTOR_CALLABLE << 1) #define LOOKUP_NAMESPACES_ONLY(F) \ (((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES)) |