]> granicus.if.org Git - clang/commitdiff
[libclang] Encode C++11 rvalue reference types in the USR.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 8 Dec 2014 08:48:27 +0000 (08:48 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 8 Dec 2014 08:48:27 +0000 (08:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@223631 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Index/USRGeneration.cpp
test/Index/usrs-cxx0x.cpp

index 88e6d3bf8ac22483ff1502123680c9275cd4815a..a41da8ae3e4e8c4ad9decf8bee1a280b1e78a4ff 100644 (file)
@@ -643,6 +643,11 @@ void USRGenerator::VisitType(QualType T) {
       T = PT->getPointeeType();
       continue;
     }
+    if (const RValueReferenceType *RT = T->getAs<RValueReferenceType>()) {
+      Out << "&&";
+      T = RT->getPointeeType();
+      continue;
+    }
     if (const ReferenceType *RT = T->getAs<ReferenceType>()) {
       Out << '&';
       T = RT->getPointeeType();
index 822fed0cd28202055932968af4a235df07745877..6f28ebc562993cc66764342e2fe543e19a4cda5f 100644 (file)
@@ -6,6 +6,7 @@ void f(tuple<int, float, double>);
 class TestCls {
   void meth() &;
   void meth() &&;
+  void meth(int&&);
 };
 
 // RUN: c-index-test -test-load-source-usrs all -std=c++11 %s | FileCheck %s
@@ -14,3 +15,4 @@ class TestCls {
 
 // CHECK: usrs-cxx0x.cpp c:@C@TestCls@F@meth#& Extent=[7:3 - 7:16]
 // CHECK: usrs-cxx0x.cpp c:@C@TestCls@F@meth#&& Extent=[8:3 - 8:17]
+// CHECK: usrs-cxx0x.cpp c:@C@TestCls@F@meth#&&I# Extent=[9:3 - 9:19]