aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/cpexprs.exp
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-06-13 16:10:10 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-06-13 16:10:10 +0000
commit50af5481d5feece564c8b03bfb4a647dc7573f3c (patch)
tree6d434da197be7f970b21ecc8f8f4afc417571b76 /gdb/testsuite/gdb.cp/cpexprs.exp
parentd55637df6923689396e58c3d789e82314f4826ec (diff)
downloadgdb-50af5481d5feece564c8b03bfb4a647dc7573f3c.zip
gdb-50af5481d5feece564c8b03bfb4a647dc7573f3c.tar.gz
gdb-50af5481d5feece564c8b03bfb4a647dc7573f3c.tar.bz2
gdb/
PR c++/14177 - Fix parsing TYPENAME:: in parentheses. * c-exp.y (classify_inner_name): Remove caller assumptions in the function comment. Return ERROR for unresolved cases. Implement returning proper NAME. (yylex): Accept also NAME from classify_inner_name. * cp-namespace.c (cp_lookup_nested_type): Rename to ... (cp_lookup_nested_symbol): ... here. Return any found symbol, not just LOC_TYPEDEF type. * cp-support.h (cp_lookup_nested_type): Update its declaration. gdb/testsuite/ PR c++/14177 - Fix parsing TYPENAME:: in parentheses. * gdb.cp/cpexprs.cc (class CV, CV::i, ATTRIBUTE_USED, CV_f): New. (test_function): Call CV_f. * gdb.cp/cpexprs.exp (p 'CV::m(int)', p CV::m(int)) (p 'CV::m(int) const', p CV::m(int) const, p 'CV::m(int) volatile') (p CV::m(int) volatile, p 'CV::m(int) const volatile') (p CV::m(int) const volatile, p CV_f(int), p CV_f(CV::t)) (p CV_f(CV::i)): New tests.
Diffstat (limited to 'gdb/testsuite/gdb.cp/cpexprs.exp')
-rw-r--r--gdb/testsuite/gdb.cp/cpexprs.exp21
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.cp/cpexprs.exp b/gdb/testsuite/gdb.cp/cpexprs.exp
index 13af265..1ae7dc0 100644
--- a/gdb/testsuite/gdb.cp/cpexprs.exp
+++ b/gdb/testsuite/gdb.cp/cpexprs.exp
@@ -719,5 +719,26 @@ foreach name [get_functions list] {
}
}
+# Test c/v gets recognized even without quoting.
+foreach cv {{} { const} { volatile} { const volatile}} {
+ set test "p 'CV::m(int)$cv'"
+ gdb_test_multiple $test $test {
+ -re "( = {.*} 0x\[0-9a-f\]+ <CV::m.*>)\r\n$gdb_prompt $" {
+ # = {void (CV * const, CV::t)} 0x400944 <CV::m(int)>
+ set correct $expect_out(1,string)
+ pass $test
+ }
+ }
+ if {"$cv" != ""} {
+ setup_kfail c++/14186 *-*-*
+ }
+ gdb_test "p CV::m(int)$cv" [string_to_regexp $correct]
+}
+
+# Test TYPENAME:: gets recognized even in parentheses.
+gdb_test "p CV_f(int)" { = {int \(int\)} 0x[0-9a-f]+ <CV_f\(int\)>}
+gdb_test "p CV_f(CV::t)" { = {int \(int\)} 0x[0-9a-f]+ <CV_f\(int\)>}
+gdb_test "p CV_f(CV::i)" " = 43"
+
gdb_exit
return 0