diff options
author | Nathan Wilson <nwilson20@gmail.com> | 2015-11-11 23:53:35 +0000 |
---|---|---|
committer | Nathan Wilson <nwilson20@gmail.com> | 2015-11-11 23:53:35 +0000 |
commit | 68b2b9b3dc9f58e46282e102fc2b76eacf11f7b7 (patch) | |
tree | 6baba104d91594861c83df157e1e6cc3ae97107c /clang/lib/Sema/SemaDecl.cpp | |
parent | 10f98135289167774f062c110ea3350ef1651c34 (diff) | |
download | bcm5719-llvm-68b2b9b3dc9f58e46282e102fc2b76eacf11f7b7.tar.gz bcm5719-llvm-68b2b9b3dc9f58e46282e102fc2b76eacf11f7b7.zip |
Add diagnostics which fall under [dcl.spec.concept]p5
Summary: Diagnose when a function concept declaration has parameter(s)
Reviewers: rsmith, faisalv, aaron.ballman, hubert.reinterpretcast
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D14352
llvm-svn: 252827
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 18d0c3491b1..02f96ec0d18 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -7607,6 +7607,13 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, } else { Context.adjustExceptionSpec(NewFD, EST_BasicNoexcept); } + + // C++ Concepts TS [dcl.spec.concept]p5: A function concept has the + // following restrictions: + // - The declaration's parameter list shall be equivalent to an empty + // parameter list. + if ((FPT->getNumParams() > 0) || (FPT->isVariadic())) + Diag(NewFD->getLocation(), diag::err_function_concept_with_params); } // C++ Concepts TS [dcl.spec.concept]p2: Every concept definition is |