*this is const in a trailing-return-type for a constexpr member function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172375 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp
index d74b337..1da7dd2 100644
--- a/test/Parser/cxx0x-decl.cpp
+++ b/test/Parser/cxx0x-decl.cpp
@@ -41,3 +41,11 @@
 };
 
 using PR14855 = int S::; // expected-error {{expected ';' after alias declaration}}
+
+// Ensure that 'this' has a const-qualified type in a trailing return type for
+// a constexpr function.
+struct ConstexprTrailingReturn {
+  int n;
+  constexpr auto f() -> decltype((n));
+};
+constexpr const int &ConstexprTrailingReturn::f() const { return n; }