summaryrefslogtreecommitdiff
path: root/gdb/cp-support.h
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-05-03 20:10:22 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-05-03 20:10:22 +0000
commit872b7c6f612a861b17cd42732356223d0503016f (patch)
treef9a753f035ff1467f4dd8eff27eb2e6522b5abe2 /gdb/cp-support.h
parentf016e160c1bc915d5826cd251db03bc43924e31f (diff)
downloadgdb-872b7c6f612a861b17cd42732356223d0503016f.tar.gz
gdb/
* cp-namespace.c (cp_lookup_symbol_imports): Support ALIAS for the CURRENT->DECLARATION case. * cp-support.h (struct using_direct): Provide extended comment.
Diffstat (limited to 'gdb/cp-support.h')
-rw-r--r--gdb/cp-support.h51
1 files changed, 38 insertions, 13 deletions
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
index f2f202f1397..dd4df842df1 100644
--- a/gdb/cp-support.h
+++ b/gdb/cp-support.h
@@ -37,19 +37,44 @@ struct type;
struct demangle_component;
/* This struct is designed to store data from using directives. It
- says that names from namespace IMPORT_SRC should be visible within
- namespace IMPORT_DEST. These form a linked list; NEXT is the next element
- of the list. If the imported namespace has been aliased, ALIAS is set to a
- string representing the alias. Otherwise, ALIAS is NULL.
- Eg:
- namespace C = A::B;
- ALIAS = "C"
- DECLARATION is the name of the imported declaration, if this import
- statement represents one.
- Eg:
- using A::x;
- Where x is variable in namespace A. DECLARATION is set to x.
-*/
+ says that names from namespace IMPORT_SRC should be visible within namespace
+ IMPORT_DEST. These form a linked list; NEXT is the next element of the
+ list. If the imported namespace or declaration has been aliased within the
+ IMPORT_DEST namespace, ALIAS is set to a string representing the alias.
+ Otherwise, ALIAS is NULL. DECLARATION is the name of the imported
+ declaration, if this import statement represents one. Otherwise DECLARATION
+ is NULL and this import statement represents a namespace.
+
+ C++: using namespace A;
+ Fortran: use A
+ import_src = "A"
+ import_dest = local scope of the import statement even such as ""
+ alias = NULL
+ declaration = NULL
+
+ C++: using A::x;
+ Fortran: use A, only: x
+ import_src = "A"
+ import_dest = local scope of the import statement even such as ""
+ alias = NULL
+ declaration = "x"
+ The declaration will get imported as import_dest::x.
+
+ C++: namespace LOCALNS = A;
+ Fortran has no way to address non-local namespace/module.
+ import_src = "A"
+ import_dest = local scope of the import statement even such as ""
+ alias = "LOCALNS"
+ declaration = NULL
+ The namespace will get imported as the import_dest::LOCALNS namespace.
+
+ C++ cannot express it, it would be something like: using localname = A::x;
+ Fortran: use A, only localname => x
+ import_src = "A"
+ import_dest = local scope of the import statement even such as ""
+ alias = "localname"
+ declaration = "x"
+ The declaration will get imported as localname or `import_dest`localname. */
struct using_direct
{