Message ID | 20160108190636.GN31604@redhat.com |
---|---|
State | New |
Headers | show |
diff --git gcc/cp/constexpr.c gcc/cp/constexpr.c index c6c3467..7b60271 100644 --- gcc/cp/constexpr.c +++ gcc/cp/constexpr.c @@ -3184,7 +3184,8 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t, r = TARGET_EXPR_INITIAL (r); if (VAR_P (r)) if (tree *p = ctx->values->get (r)) - r = *p; + if (*p != NULL_TREE) + r = *p; if (DECL_P (r)) { if (!ctx->quiet) diff --git gcc/testsuite/g++.dg/pr68449.C gcc/testsuite/g++.dg/pr68449.C index e69de29..7d86fe9 100644 --- gcc/testsuite/g++.dg/pr68449.C +++ gcc/testsuite/g++.dg/pr68449.C @@ -0,0 +1,9 @@ +// PR c++/68449 +// { dg-do compile } +// { dg-options "-Wsign-compare" } + +int +foo (int a) +{ + return __extension__ ({ int b; b; }) < 0; +}