Index: include/clang-c/Index.h
===================================================================
--- include/clang-c/Index.h	(revision 191939)
+++ include/clang-c/Index.h	(working copy)
@@ -3002,7 +3002,24 @@
  */
 CINDEX_LINKAGE long long clang_Type_getOffsetOf(CXType T, const char *S);
 
+enum CXRefQualifierKind {
+  /** \brief No ref-qualifier was provided. */
+  CXRQ_None = 0,
+  /** \brief An lvalue ref-qualifier was provided (\c &). */
+  CXRQ_LValue,
+  /** \brief An rvalue ref-qualifier was provided (\c &&). */
+  CXRQ_RValue
+};
+
 /**
+ * \brief Retrieve the ref-qualifier kind of a function or method.
+ *
+ * The ref-qualifier is returned for functions or methods. For other types
+ * CXRQ_None is returned.
+ */
+CINDEX_LINKAGE enum CXRefQualifierKind clang_Type_getRefQualifier(CXType T);
+
+/**
  * \brief Returns non-zero if the cursor specifies a Record member that is a
  *   bitfield.
  */
Index: bindings/python/clang/cindex.py
===================================================================
--- bindings/python/clang/cindex.py	(revision 191939)
+++ bindings/python/clang/cindex.py	(working copy)
@@ -1499,6 +1499,50 @@
 TypeKind.DEPENDENTSIZEDARRAY = TypeKind(116)
 TypeKind.MEMBERPOINTER = TypeKind(117)
 
+class RefQualifierKind(object):
+    """Describes a specific ref-qualifier of a type."""
+
+    # The unique kind objects, indexed by id.
+    _kinds = []
+    _name_map = None
+
+    def __init__(self, value):
+        if value >= len(RefQualifierKind._kinds):
+            num_kinds = value - len(RefQualifierKind._kinds) + 1
+            RefQualifierKind._kinds += [None] * num_kinds
+        if RefQualifierKind._kinds[value] is not None:
+            raise ValueError, 'RefQualifierKind already loaded'
+        self.value = value
+        RefQualifierKind._kinds[value] = self
+        RefQualifierKind._name_map = None
+
+    def from_param(self):
+        return self.value
+
+    @property
+    def name(self):
+        """Get the enumeration name of this kind."""
+        if self._name_map is None:
+            self._name_map = {}
+            for key, value in RefQualifierKind.__dict__.items():
+                if isinstance(value, RefQualifierKind):
+                    self._name_map[value] = key
+        return self._name_map[self]
+
+    @staticmethod
+    def from_id(id):
+        if (id >= len(RefQualifierKind._kinds) or
+                RefQualifierKind._kinds[id] is None):
+            raise ValueError, 'Unknown type kind %d' % id
+        return RefQualifierKind._kinds[id]
+
+    def __repr__(self):
+        return 'RefQualifierKind.%s' % (self.name,)
+
+RefQualifierKind.NONE = RefQualifierKind(0)
+RefQualifierKind.LVALUE = RefQualifierKind(1)
+RefQualifierKind.RVALUE = RefQualifierKind(2)
+
 class Type(Structure):
     """
     The type of an element in the abstract syntax tree.
@@ -1697,6 +1741,13 @@
         """
         return conf.lib.clang_Type_getOffsetOf(self, c_char_p(fieldname))
 
+    def get_ref_qualifier(self):
+        """
+        Retrieve the ref-qualifier of the type.
+        """
+        return RefQualifierKind.from_id(
+                conf.lib.clang_Type_getRefQualifier(self))
+
     @property
     def spelling(self):
         """Retrieve the spelling of this Type."""
@@ -2716,11 +2767,6 @@
    [Type],
    c_longlong),
 
-  ("clang_Type_getClassType",
-   [Type],
-   Type,
-   Type.from_result),
-
   ("clang_getFieldDeclBitWidth",
    [Cursor],
    c_int),
@@ -3164,6 +3210,11 @@
    [Type],
    c_longlong),
 
+  ("clang_Type_getClassType",
+   [Type],
+   Type,
+   Type.from_result),
+
   ("clang_Type_getOffsetOf",
    [Type, c_char_p],
    c_longlong),
@@ -3171,6 +3222,10 @@
   ("clang_Type_getSizeOf",
    [Type],
    c_longlong),
+
+  ("clang_Type_getRefQualifier",
+   [Type],
+   c_uint),
 ]
 
 class LibclangError(Exception):
Index: tools/libclang/CXType.cpp
===================================================================
--- tools/libclang/CXType.cpp	(revision 191939)
+++ tools/libclang/CXType.cpp	(working copy)
@@ -816,6 +816,24 @@
   return CXTypeLayoutError_InvalidFieldName;
 }
 
+enum CXRefQualifierKind clang_Type_getRefQualifier(CXType T) {
+  QualType QT = GetQualType(T);
+  if (QT.isNull())
+    return CXRQ_None;
+  const FunctionProtoType *FD = QT->getAs<FunctionProtoType>();
+  if (!FD)
+    return CXRQ_None;
+  switch (FD->getRefQualifier()) {
+    case RQ_None:
+      return CXRQ_None;
+    case RQ_LValue:
+      return CXRQ_LValue;
+    case RQ_RValue:
+      return CXRQ_RValue;
+  }
+  return CXRQ_None;
+}
+
 unsigned clang_Cursor_isBitField(CXCursor C) {
   if (!clang_isDeclaration(C.kind))
     return 0;
Index: tools/libclang/libclang.exports
===================================================================
--- tools/libclang/libclang.exports	(revision 191939)
+++ tools/libclang/libclang.exports	(working copy)
@@ -64,6 +64,7 @@
 clang_Type_getClassType
 clang_Type_getSizeOf
 clang_Type_getOffsetOf
+clang_Type_getRefQualifier
 clang_VerbatimBlockLineComment_getText
 clang_VerbatimLineComment_getText
 clang_HTMLTagComment_getAsString
