[cfe-commits] r150586 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/AnalysisBasedWarnings.cpp lib/Sema/SemaStmt.cpp test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp test/CXX/ex

Douglas Gregor dgregor at apple.com
Wed Feb 15 13:48:53 PST 2012


On Feb 15, 2012, at 11:26 AM, Richard Smith <richard at metafoo.co.uk> wrote:

> On Wed, Feb 15, 2012 at 8:20 AM, Douglas Gregor <dgregor at apple.com> wrote:
> Author: dgregor
> Date: Wed Feb 15 10:20:15 2012
> New Revision: 150586
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=150586&view=rev
> Log:
> Specialize noreturn diagnostics for lambda expressions.
> 
> Modified:
>    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
>    cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
>    cfe/trunk/lib/Sema/SemaStmt.cpp
>    cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
>    cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/p7.cpp
>    cfe/trunk/test/CXX/expr/expr.prim/expr.prim.lambda/templates.cpp
> 
> Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=150586&r1=150585&r2=150586&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Wed Feb 15 10:20:15 2012
> @@ -4045,6 +4045,14 @@
>   def ext_lambda_default_arguments : ExtWarn<
>     "C++11 forbids default arguments for lambda expressions">,
>     InGroup<LambdaExtensions>;
> +  def err_noreturn_lambda_has_return_expr : Error<
> +    "lambda declared 'noreturn' should not return">;
> +  def warn_maybe_falloff_nonvoid_lambda : Warning<
> +    "control may reach end of non-void lambda">,
> +    InGroup<ReturnType>;
> +  def warn_falloff_nonvoid_lambda : Warning<
> +    "control reaches end of non-void lambda">,
> +    InGroup<ReturnType>;
>  }
> 
>  def err_operator_arrow_circular : Error<
> 
> Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=150586&r1=150585&r2=150586&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
> +++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Wed Feb 15 10:20:15 2012
> @@ -218,7 +218,8 @@
>   unsigned diag_AlwaysFallThrough_HasNoReturn;
>   unsigned diag_AlwaysFallThrough_ReturnsNonVoid;
>   unsigned diag_NeverFallThroughOrReturn;
> -  bool funMode;
> +  enum { Function, Block, Lambda } funMode;
> +  bool IsLambda;
> 
> It looks like you're not using this new member.

Fixed in r150611, thanks!

	- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120215/74e059b6/attachment.html>


More information about the cfe-commits mailing list