summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/koenig.cc
Commit message (Collapse)AuthorAgeFilesLines
* [gdb/testsuite] Initialize anonymous union in gdb.cp/koenig.ccKavitha Natarajan2021-10-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | GDB test fails while running the test case gdb.cp/koenig.exp using clang compiler: [...] p foo (p_union) No symbol "p_union" in current context. (gdb) FAIL: gdb.cp/koenig.exp: p foo (p_union) [...] In the testcase, "p_union" is an unused/uninitialized variable of anonymous union type. Clang does not emit symbol for unused anonymous union/struct variables at any optimization level. Since the compiler itself is not emitting the symbol for "p_union", debug info is also not emitted when built with debug option. If the anonymous union is initialized (or used), then clang emits the symbol "p_union" which enables emitting debug info for "p_union". [...] p foo (p_union) Cannot resolve function foo to any overloaded instance (gdb) PASS: gdb.cp/koenig.exp: p foo (p_union) [...]
* gdb/Jan Kratochvil2011-10-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support @entry in input expressions. * c-exp.y (ENTRY, unknown_cpp_name): New. (exp: UNKNOWN_CPP_NAME): Change to `exp: unknown_cpp_name'. (unknown_cpp_name: UNKNOWN_CPP_NAME, unknown_cpp_name: ENTRY) (variable: name_not_typename '@' ENTRY, name: ENTRY) (name_not_typename: ENTRY): New. (yylex): Recognize ENTRY. * eval.c (evaluate_subexp_standard): Support also OP_VAR_ENTRY_VALUE. * expprint.c (print_subexp_standard, dump_subexp_body_standard): Likewise. * parse.c (operator_length_standard): Likewise. * std-operator.def: New operator OP_VAR_ENTRY_VALUE. gdb/doc/ Support @entry in input expressions. * gdb.texinfo (Variables): Describe @entry names suffix. (Print Settings): Add anchor for `set print entry-values'. gdb/testsuite/ Support @entry in input expressions. * gdb.arch/amd64-entry-value.exp (entry: p i@entry, entry: p j@entry) (entry_stack: p s1@entry, entry_stack: p s2@entry) (entry_stack: p d9@entry, entry_stack: p da@entry, tailcall: p i@entry) (tailcall: p j@entry): New tests. * gdb.cp/koenig.cc (A::entry): New function. (main): Call it. * gdb.cp/koenig.exp (p entry (c)): New test.
* Fix PR 11992: C++ 'this' scope sometimes does not workSami Wagiaalla2010-09-131-0/+14
| | | | | | | | | | | | | 2010-09-13 Sami Wagiaalla <swagiaal@redhat.com> PR symtab/11992: * c-exp.y (classify_name): Check is_a_member_of_this before returning UNKNOWN_CPP_NAME. 2010-09-13 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/koenig.cc: created class for testing member lookup. * gdb.cp/koenig.exp: Added test for member lookup.
* Test and support all cpp operator types.Sami Wagiaalla2010-06-071-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2010-06-07 Sami Wagiaalla <swagiaal@redhat.com> * value.h: Created oload_search_type enum. (find_overload_match): Use oload_search_type enum. * valops.c (find_overload_match): Support combined member and non-member search. * eval.c (evaluate_subexp_standard): Calls to find_overload_match now use oload_search_type enum. (oload_method_static): Verify index is a proper value. * valarith.c (value_user_defined_cpp_op): Search for and handle both member and non-member operators. (value_user_defined_cpp_op): New function. (value_user_defined_op): New function. (value_x_unop): Use value_user_defined_op. (value_x_binop): Ditto. * cp-support.c (make_symbol_overload_list_using): Added block iteration. Add check for namespace aliases and imported declarations. 2010-06-07 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/koenig.exp: Test for ADL operators. * gdb.cp/koenig.cc: Added ADL operators. * gdb.cp/operator.exp: New test. * gdb.cp/operator.cc: New test.
* Fix ADL anonymous name crash.Sami Wagiaalla2010-06-021-0/+7
| | | | | | | | | | | | 2010-06-02 Sami Wagiaalla <swagiaal@redhat.com> * cp-support.c (make_symbol_overload_list_adl_namespace): Handle anonymous type case. 2010-06-02 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/koenig.exp: Added new test case. * gdb.cp/koenig.cc: Ditto.
* Add ADL supportSami Wagiaalla2010-05-071-0/+245
2010-05-07 Sami Wagiaalla <swagiaal@redhat.com> PR C++/7943: * valops.c (find_overload_match): Handle fsym == NULL case. Add int no_adl argument. (find_oload_champ_namespace_loop): Call make_symbol_overload_list_adl when appropriate. Add int no_adl argument. (find_oload_champ_namespace): Add int no_adl argument. * parse.c (operator_length_standard): Return length for OP_ADL_FUNC expression. * expprint.c (op_name_standard): Added string for OP_ADL_FUNC case. * eval.c (evaluate_subexp_standard): Added OP_ADL_FUNC case. Evaluate arguments and use them to perform ADL lookup. Pass no_adl argument to find_overload_match. Disable adl lookup when evaluating a fully qualified OP_FUNCALL. * cp-support.h: Added prototype for make_symbol_overload_list_namespace. * cp-support.c (make_symbol_overload_list_namespace): New function. (make_symbol_overload_list_adl_namespace): New function. (make_symbol_overload_list_adl): New function. (make_symbol_overload_list_using): Moved code to add function to overload set to make_symbol_overload_list_namespace. * c-exp.y: create UNKNOWN_CPP_NAME token. Add parse rule for ADL functions. (classify_name): Recognize an UNKNOWN_CPP_NAME. 2010-05-07 Sami Wagiaalla <swagiaal@redhat.com> * gdb.cp/koenig.exp: New test. * gdb.cp/koenig.cc: New test program.