r223631 - [libclang] Encode C++11 rvalue reference types in the USR.
Argyrios Kyrtzidis
akyrtzi at gmail.com
Mon Dec 8 00:48:27 PST 2014
Author: akirtzidis
Date: Mon Dec 8 02:48:27 2014
New Revision: 223631
URL: http://llvm.org/viewvc/llvm-project?rev=223631&view=rev
Log:
[libclang] Encode C++11 rvalue reference types in the USR.
Modified:
cfe/trunk/lib/Index/USRGeneration.cpp
cfe/trunk/test/Index/usrs-cxx0x.cpp
Modified: cfe/trunk/lib/Index/USRGeneration.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/USRGeneration.cpp?rev=223631&r1=223630&r2=223631&view=diff
==============================================================================
--- cfe/trunk/lib/Index/USRGeneration.cpp (original)
+++ cfe/trunk/lib/Index/USRGeneration.cpp Mon Dec 8 02:48:27 2014
@@ -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();
Modified: cfe/trunk/test/Index/usrs-cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/usrs-cxx0x.cpp?rev=223631&r1=223630&r2=223631&view=diff
==============================================================================
--- cfe/trunk/test/Index/usrs-cxx0x.cpp (original)
+++ cfe/trunk/test/Index/usrs-cxx0x.cpp Mon Dec 8 02:48:27 2014
@@ -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 at TestCls@F at meth#& Extent=[7:3 - 7:16]
// CHECK: usrs-cxx0x.cpp c:@C at TestCls@F at meth#&& Extent=[8:3 - 8:17]
+// CHECK: usrs-cxx0x.cpp c:@C at TestCls@F at meth#&&I# Extent=[9:3 - 9:19]
More information about the cfe-commits
mailing list