forked from OSchip/llvm-project
*this is const in a trailing-return-type for a constexpr member function.
llvm-svn: 172375
This commit is contained in:
parent
4385edf5cb
commit
01141a95a5
|
@ -4761,7 +4761,9 @@ void Parser::ParseFunctionDeclarator(Declarator &D,
|
|||
Actions.CurContext->isRecord()));
|
||||
Sema::CXXThisScopeRAII ThisScope(Actions,
|
||||
dyn_cast<CXXRecordDecl>(Actions.CurContext),
|
||||
DS.getTypeQualifiers(),
|
||||
DS.getTypeQualifiers() |
|
||||
(D.getDeclSpec().isConstexprSpecified()
|
||||
? Qualifiers::Const : 0),
|
||||
IsCXX11MemberFunction);
|
||||
|
||||
// Parse exception-specification[opt].
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Reference in New Issue