From c5748fdbf403203195e20cfc06acfa96a733486e Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 11 Sep 2019 12:38:23 +0100 Subject: [PATCH] Fix Xmethod for shared_ptr::use_count() This was reported in https://bugzilla.redhat.com/show_bug.cgi?id=1749578 * python/libstdcxx/v6/xmethods.py (SharedPtrUseCountWorker.__call__): Fix syntax error. From-SVN: r275644 --- libstdc++-v3/ChangeLog | 3 +++ libstdc++-v3/python/libstdcxx/v6/xmethods.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9472efb1bfd..1d01e8c467d 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,8 @@ 2019-09-11 Jonathan Wakely + * python/libstdcxx/v6/xmethods.py (SharedPtrUseCountWorker.__call__): + Fix syntax error. + * testsuite/20_util/result_of/sfinae_friendly_1.cc: Add -Wno-volatile for C++2a and up. Define HAS_52748_FIXED and fix incorrect tests. * testsuite/tr1/3_function_objects/result_of.cc: Add -Wno-volatile diff --git a/libstdc++-v3/python/libstdcxx/v6/xmethods.py b/libstdc++-v3/python/libstdcxx/v6/xmethods.py index 623cb80bc0e..a720a63fa1a 100644 --- a/libstdc++-v3/python/libstdcxx/v6/xmethods.py +++ b/libstdc++-v3/python/libstdcxx/v6/xmethods.py @@ -739,7 +739,7 @@ class SharedPtrUseCountWorker(gdb.xmethod.XMethodWorker): return gdb.lookup_type('long') def __call__(self, obj): - refcounts = ['_M_refcount']['_M_pi'] + refcounts = obj['_M_refcount']['_M_pi'] return refcounts['_M_use_count'] if refcounts else 0 class SharedPtrUniqueWorker(SharedPtrUseCountWorker): -- 2.30.2