re PR libstdc++/67440 (pretty-printing of a const set<foo> fails)
authorDoug Evans <dje@google.com>
Mon, 16 Nov 2015 21:32:26 +0000 (21:32 +0000)
committerDoug Evans <devans@gcc.gnu.org>
Mon, 16 Nov 2015 21:32:26 +0000 (21:32 +0000)
PR libstdc++/67440
* python/libstdcxx/v6/printers.py (find_type): Handle "const" in
type name.
* testsuite/libstdc++-prettyprinters/debug.cc: Add test for
const set<int>.
* testsuite/libstdc++-prettyprinters/simple.cc: Ditto.
* testsuite/libstdc++-prettyprinters/simple11.cc: Ditto.

From-SVN: r230437

libstdc++-v3/ChangeLog
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/testsuite/libstdc++-prettyprinters/debug.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/simple11.cc

index fcef035..9ef0890 100644 (file)
@@ -1,3 +1,13 @@
+2015-11-16  Doug Evans  <dje@google.com>
+
+       PR libstdc++/67440
+       * python/libstdcxx/v6/printers.py (find_type): Handle "const" in
+       type name.
+       * testsuite/libstdc++-prettyprinters/debug.cc: Add test for
+       const set<int>.
+       * testsuite/libstdc++-prettyprinters/simple.cc: Ditto.
+       * testsuite/libstdc++-prettyprinters/simple11.cc: Ditto.
+
 2015-11-15  Jonathan Wakely  <jwakely@redhat.com>
 
        PR libstdc++/68353
index 12e732e..14f786a 100644 (file)
@@ -85,7 +85,9 @@ except ImportError:
 def find_type(orig, name):
     typ = orig.strip_typedefs()
     while True:
-        search = str(typ) + '::' + name
+        # Use typ.name here instead of str(typ) to discard any const,etc.
+        # qualifiers.  PR 67440.
+        search = typ.name + '::' + name
         try:
             return gdb.lookup_type(search)
         except RuntimeError:
index c62ef61..8d40f17 100644 (file)
@@ -70,6 +70,10 @@ main()
   std::map<std::string, int>::iterator mpiter = mp.begin();
 // { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
 
+  // PR 67440
+  const std::set<int> const_intset = {2, 3};
+// { dg-final { note-test const_intset {std::__debug::set with 2 elements = {[0] = 2, [1] = 3}} } }
+
   std::set<std::string> sp;
   sp.insert("clownfish");
   sp.insert("barrel");
index ad3c256..68c4d83 100644 (file)
@@ -73,6 +73,10 @@ main()
   std::map<std::string, int>::iterator mpiter = mp.begin();
 // { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
 
+  // PR 67440
+  const std::set<int> const_intset = {2, 3};
+// { dg-final { note-test const_intset {std::set with 2 elements = {[0] = 2, [1] = 3}} } }
+
   std::set<std::string> sp;
   sp.insert("clownfish");
   sp.insert("barrel");
index ba36a6a..5f7e9a6 100644 (file)
@@ -73,6 +73,10 @@ main()
   std::map<std::string, int>::iterator mpiter = mp.begin();
 // { dg-final { note-test mpiter {{first = "zardoz", second = 23}} } }
 
+  // PR 67440
+  const std::set<int> const_intset = {2, 3};
+// { dg-final { note-test const_intset {std::set with 2 elements = {[0] = 2, [1] = 3}} } }
+
   std::set<std::string> sp;
   sp.insert("clownfish");
   sp.insert("barrel");