diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-14 01:55:13 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-01-14 01:55:13 +0000 |
commit | 7b19cb116d0909de72dc8242b0a4e6c5ed39d421 (patch) | |
tree | 717d8de8c6a0918bd20d1cb3aaf2c4ccb24f9a16 /test/Parser/cxx0x-decl.cpp | |
parent | 05756dc8d11cd2054e0cb94f0302e4eb39acc68e (diff) |
*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
Diffstat (limited to 'test/Parser/cxx0x-decl.cpp')
-rw-r--r-- | test/Parser/cxx0x-decl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp index d74b337b31..1da7dd2833 100644 --- a/test/Parser/cxx0x-decl.cpp +++ b/test/Parser/cxx0x-decl.cpp @@ -41,3 +41,11 @@ struct SS { }; 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; } |