diff options
author | David Carlton <carlton@bactrian.org> | 2004-02-02 20:44:53 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2004-02-02 20:44:53 +0000 |
commit | 8d577d328a1339e8b7107206c058b852e083f16b (patch) | |
tree | 25cd70f71ea631c6f5805f9e1aa5478b34d3c203 /gdb/testsuite/gdb.cp/overload.cc | |
parent | 15390fef31f1aa09ab3da757a878d047305d7e5c (diff) | |
download | gdb-8d577d328a1339e8b7107206c058b852e083f16b.zip gdb-8d577d328a1339e8b7107206c058b852e083f16b.tar.gz gdb-8d577d328a1339e8b7107206c058b852e083f16b.tar.bz2 |
2004-02-02 David Carlton <carlton@kealia.com>
* valops.c (enum oload_classification): New.
(find_overload_match): Break implementation into separate
functions; delete #if 0'd code; look for symbols within
namespaces.
(find_oload_champ_namespace,find_oload_champ_namespace_loop)
(find_oload_champ,oload_method_static,classify_oload_match): New.
* cp-support.h: Add declaration for cp_func_name; update
declaration for make_symbol_overload_list.
* cp-support.c (cp_func_name): New.
(overload_list_add_symbol): Fix comment, use
SYMBOL_LINKAGE_NAME and SYMBOL_NATURAL_NAME.
(make_symbol_overload_list): Take a function name and a namespace
instead of a symbol; change implementation.
(make_symbol_overload_list_using): New.
(make_symbol_overload_list_qualified, read_in_psymtabs): New.
2004-02-02 David Carlton <carlton@kealia.com>
* gdb.cp/overload.exp: Add overloadNamespace tests.
* gdb.cp/overload.cc (dummyClass, dummyInstance): New.
(overloadNamespace, XXX): New.
(main): Call XXX::marker2.
Diffstat (limited to 'gdb/testsuite/gdb.cp/overload.cc')
-rw-r--r-- | gdb/testsuite/gdb.cp/overload.cc | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.cp/overload.cc b/gdb/testsuite/gdb.cp/overload.cc index 56afc96..a41e14d 100644 --- a/gdb/testsuite/gdb.cp/overload.cc +++ b/gdb/testsuite/gdb.cp/overload.cc @@ -53,6 +53,31 @@ int intToChar (char c) void marker1() {} +// Now test how overloading and namespaces interact. + +class dummyClass {}; + +dummyClass dummyInstance; + +int overloadNamespace(int i) +{ + return 1; +} + +int overloadNamespace(dummyClass d) +{ + return 2; +} + +namespace XXX { + int overloadNamespace (char c) + { + return 3; + } + + void marker2() {} +} + int main () { char arg2 = 2; @@ -81,7 +106,8 @@ int main () intToChar(1); marker1(); // marker1-returns-here - return 0; // marker1-returns-here + XXX::marker2(); // marker1-returns-here + return 0; } foo::foo (int i) { ifoo = i; ccpfoo = NULL; } |