[demangler] Support for sequence numbers on lifetime extended temporaries.

git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@327227 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/src/cxa_demangle.cpp b/src/cxa_demangle.cpp
index 5c313cb..bc6bbc1 100644
--- a/src/cxa_demangle.cpp
+++ b/src/cxa_demangle.cpp
@@ -4324,6 +4324,8 @@
 //                                     # No <type>
 //                ::= TW <object name> # Thread-local wrapper
 //                ::= TH <object name> # Thread-local initialization
+//                ::= GR <object name> _             # First temporary
+//                ::= GR <object name> <seq-id> _    # Subsequent temporaries
 //      extension ::= TC <first type> <number> _ <second type> # construction vtable for second-in-first
 //      extension ::= GR <object name> # reference temporary for object
 Node *Db::parseSpecialName() {
@@ -4428,11 +4430,17 @@
       return make<SpecialName>("guard variable for ", Name);
     }
     // GR <object name> # reference temporary for object
+    // GR <object name> _             # First temporary
+    // GR <object name> <seq-id> _    # Subsequent temporaries
     case 'R': {
       First += 2;
       Node *Name = parseName();
       if (Name == nullptr)
         return nullptr;
+      size_t Count;
+      bool ParsedSeqId = !parseSeqId(&Count);
+      if (!consumeIf('_') && ParsedSeqId)
+        return nullptr;
       return make<SpecialName>("reference temporary for ", Name);
     }
     }