summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-12-08 08:48:27 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-12-08 08:48:27 +0000
commit0e387dc33096346c5aa60c341f38784fc0ddcbb7 (patch)
tree151528579bc62465af8b938ba8134c01c49d2af2
parentf581909b3bbcff5301795f9ff2172cf4ac9bcb66 (diff)
downloadbcm5719-llvm-0e387dc33096346c5aa60c341f38784fc0ddcbb7.tar.gz
bcm5719-llvm-0e387dc33096346c5aa60c341f38784fc0ddcbb7.zip
[libclang] Encode C++11 rvalue reference types in the USR.
llvm-svn: 223631
-rw-r--r--clang/lib/Index/USRGeneration.cpp5
-rw-r--r--clang/test/Index/usrs-cxx0x.cpp2
2 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Index/USRGeneration.cpp b/clang/lib/Index/USRGeneration.cpp
index 88e6d3bf8ac..a41da8ae3e4 100644
--- a/clang/lib/Index/USRGeneration.cpp
+++ b/clang/lib/Index/USRGeneration.cpp
@@ -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();
diff --git a/clang/test/Index/usrs-cxx0x.cpp b/clang/test/Index/usrs-cxx0x.cpp
index 822fed0cd28..6f28ebc5629 100644
--- a/clang/test/Index/usrs-cxx0x.cpp
+++ b/clang/test/Index/usrs-cxx0x.cpp
@@ -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]
OpenPOWER on IntegriCloud