aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2016-08-05 18:27:46 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2016-08-05 12:27:46 -0600
commit64d6d39969e4621e0b88f695e9b2fc6486d13e8f (patch)
treeeb59498ed44a484aa178719a4e9d7b4b484791ad /gcc
parent88fa5555a309e5d6c6171b957daaf2f800920869 (diff)
downloadgcc-64d6d39969e4621e0b88f695e9b2fc6486d13e8f.zip
gcc-64d6d39969e4621e0b88f695e9b2fc6486d13e8f.tar.gz
gcc-64d6d39969e4621e0b88f695e9b2fc6486d13e8f.tar.bz2
constexpr.c (cxx_eval_store_expression): Remove hyphen from the spelling of "constant-expression" in diagnostic messages...
gcc/cp/ChangeLog: * constexpr.c (cxx_eval_store_expression): Remove hyphen from the spelling of "constant-expression" in diagnostic messages for consistency. (cxx_eval_constant_expression): Same. (cxx_eval_outermost_constant_expr): Same. (potential_constant_expression_1): Same. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/constexpr-cast.C: Avoid assuming (void*)1 is spelled 1ul in diagnostics. Remove hyphen from "constant-expression." * g++.dg/cpp0x/constexpr-50060.C: Adjust. * g++.dg/cpp0x/static_assert3.C: Same. * g++.dg/cpp1y/constexpr-throw.C: Same. * g++.dg/template/nontype3.C: Same. * g++.dg/warn/overflow-warn-1.C: Same. * g++.dg/warn/overflow-warn-3.C: Same. * g++.dg/warn/overflow-warn-4.C: Same. From-SVN: r239176
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/constexpr.c22
-rw-r--r--gcc/testsuite/ChangeLog12
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/static_assert3.C2
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C8
-rw-r--r--gcc/testsuite/g++.dg/template/nontype3.C4
-rw-r--r--gcc/testsuite/g++.dg/warn/overflow-warn-1.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/overflow-warn-3.C4
-rw-r--r--gcc/testsuite/g++.dg/warn/overflow-warn-4.C4
11 files changed, 46 insertions, 25 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ddafa93..b2307e9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+2016-08-05 Martin Sebor <msebor@redhat.com>
+
+ * constexpr.c (cxx_eval_store_expression): Remove hyphen from
+ the spelling of "constant-expression" in diagnostic messages
+ for consistency.
+ (cxx_eval_constant_expression): Same.
+ (cxx_eval_outermost_constant_expr): Same.
+ (potential_constant_expression_1): Same.
+
2016-08-05 Nathan Sidwell <nathan@acm.org>
PR c++/68724
diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 41665c5..e7b08c8 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -3171,7 +3171,7 @@ cxx_eval_store_expression (const constexpr_ctx *ctx, tree t,
/* A constant-expression cannot modify objects from outside the
constant-expression. */
if (!ctx->quiet)
- error ("modification of %qE is not a constant-expression", object);
+ error ("modification of %qE is not a constant expression", object);
*non_constant_p = true;
return t;
}
@@ -4098,7 +4098,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
{
if (!ctx->quiet)
error_at (EXPR_LOC_OR_LOC (t, input_location),
- "a reinterpret_cast is not a constant-expression");
+ "a reinterpret_cast is not a constant expression");
*non_constant_p = true;
return t;
}
@@ -4140,7 +4140,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
if (!ctx->quiet)
error_at (EXPR_LOC_OR_LOC (t, input_location),
"%<reinterpret_cast<%T>(%E)%> is not "
- "a constant-expression",
+ "a constant expression",
type, op);
*non_constant_p = true;
return t;
@@ -4202,7 +4202,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
case OFFSET_REF:
if (!ctx->quiet)
error_at (EXPR_LOC_OR_LOC (t, input_location),
- "expression %qE is not a constant-expression", t);
+ "expression %qE is not a constant expression", t);
*non_constant_p = true;
break;
@@ -4283,7 +4283,7 @@ cxx_eval_constant_expression (const constexpr_ctx *ctx, tree t,
so for now just fail. */
if (!ctx->quiet)
error_at (EXPR_LOCATION (t),
- "statement is not a constant-expression");
+ "statement is not a constant expression");
}
else
internal_error ("unexpected expression %qE of kind %s", t,
@@ -4370,7 +4370,7 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
{
if (!allow_non_constant)
error ("conversion from pointer type %qT "
- "to arithmetic type %qT in a constant-expression",
+ "to arithmetic type %qT in a constant expression",
TREE_TYPE (TREE_OPERAND (r, 0)), TREE_TYPE (r));
non_constant_p = true;
}
@@ -5068,7 +5068,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
case AT_ENCODE_EXPR:
fail:
if (flags & tf_error)
- error ("expression %qE is not a constant-expression", t);
+ error ("expression %qE is not a constant expression", t);
return false;
case TYPEID_EXPR:
@@ -5229,7 +5229,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
if (integer_zerop (denom))
{
if (flags & tf_error)
- error ("division by zero is not a constant-expression");
+ error ("division by zero is not a constant expression");
return false;
}
else
@@ -5334,7 +5334,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
{
if (flags & tf_error)
error_at (location_of (t),
- "%<delete[]%> is not a constant-expression");
+ "%<delete[]%> is not a constant expression");
return false;
}
/* Fall through. */
@@ -5357,7 +5357,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
want_rval, strict, tf_none))
return true;
if (flags & tf_error)
- error ("expression %qE is not a constant-expression", t);
+ error ("expression %qE is not a constant expression", t);
return false;
case VEC_INIT_EXPR:
@@ -5385,7 +5385,7 @@ potential_constant_expression_1 (tree t, bool want_rval, bool strict,
if (breaks (target) || continues (target))
return true;
if (flags & tf_error)
- error ("%<goto%> is not a constant-expression");
+ error ("%<goto%> is not a constant expression");
return false;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 997efac..3c1fbf0 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,15 @@
+2016-08-05 Martin Sebor <msebor@redhat.com>
+
+ * g++.dg/cpp0x/constexpr-cast.C: Avoid assuming (void*)1 is spelled
+ 1ul in diagnostics. Remove hyphen from "constant-expression."
+ * g++.dg/cpp0x/constexpr-50060.C: Adjust.
+ * g++.dg/cpp0x/static_assert3.C: Same.
+ * g++.dg/cpp1y/constexpr-throw.C: Same.
+ * g++.dg/template/nontype3.C: Same.
+ * g++.dg/warn/overflow-warn-1.C: Same.
+ * g++.dg/warn/overflow-warn-3.C: Same.
+ * g++.dg/warn/overflow-warn-4.C: Same.
+
2016-08-05 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/plugin/diagnostic-test-string-literals-1.c: New file.
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C
index ee1c221..d2df08e 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-50060.C
@@ -12,7 +12,7 @@ struct S
struct T
{
- constexpr T (double a) : y {}, x ((y = 1, 0.8125)) {} // { dg-error "is not a constant-expression" "T" { target { ! c++14 } } }
+ constexpr T (double a) : y {}, x ((y = 1, 0.8125)) {} // { dg-error "is not a constant expression" "T" { target { ! c++14 } } }
double x;
int y;
};
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C
index 8e11193..bab6ec3 100644
--- a/gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C
@@ -8,7 +8,7 @@ int i;
constexpr void *q = reinterpret_cast<void*>(&i); // { dg-error "" "bug c++/49171" { xfail *-*-*-* } }
constexpr void *r0 = reinterpret_cast<void*>(1); // { dg-error "not a constant expression" }
-constexpr void *r1 = reinterpret_cast<void*>(sizeof 'x'); // { dg-error ".reinterpret_cast<void\\*>\\(1ul\\). is not a constant-expression" }
+constexpr void *r1 = reinterpret_cast<void*>(sizeof 'x'); // { dg-error ".reinterpret_cast<void\\*>\\(1\[ul\]\*\\). is not a constant expression" }
template <class T>
constexpr bool f ()
diff --git a/gcc/testsuite/g++.dg/cpp0x/static_assert3.C b/gcc/testsuite/g++.dg/cpp0x/static_assert3.C
index addde13..91ed9ca 100644
--- a/gcc/testsuite/g++.dg/cpp0x/static_assert3.C
+++ b/gcc/testsuite/g++.dg/cpp0x/static_assert3.C
@@ -1,4 +1,4 @@
// { dg-do compile { target c++11 } }
static_assert(7 / 0, "X"); // { dg-error "non-constant condition" "non-constant" }
// { dg-warning "division by zero" "zero" { target *-*-* } 2 }
-// { dg-error "division by zero is not a constant-expression" "not a constant" { target *-*-* } 2 }
+// { dg-error "division by zero is not a constant expression" "not a constant" { target *-*-* } 2 }
diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C
index ac90051..eed0720 100644
--- a/gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C
+++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-throw.C
@@ -8,25 +8,25 @@ constexpr void f1() {
constexpr void f2() {
if (true)
throw;
-} // { dg-error "not a constant-expression" }
+} // { dg-error "not a constant expression" }
constexpr void f3() {
if (false)
;
else
throw;
-}// { dg-error "not a constant-expression" }
+}// { dg-error "not a constant expression" }
constexpr void f4() {
throw;
-}// { dg-error "not a constant-expression" }
+}// { dg-error "not a constant expression" }
constexpr int fun(int n) {
switch (n) {
case 0:
return 1;
default:
- throw; // { dg-error "not a constant-expression" }
+ throw; // { dg-error "not a constant expression" }
}
}
diff --git a/gcc/testsuite/g++.dg/template/nontype3.C b/gcc/testsuite/g++.dg/template/nontype3.C
index d0c6b72..1899ed0 100644
--- a/gcc/testsuite/g++.dg/template/nontype3.C
+++ b/gcc/testsuite/g++.dg/template/nontype3.C
@@ -31,8 +31,8 @@ template <int PI[1]>
void dep10(foo< PI[0] > *); // { dg-error "" "integral or enumeration" }
template <int I>
-void dep11(foo< *&I > *); // { dg-error "" "constant-expression" }
+void dep11(foo< *&I > *); // { dg-error "" "constant expression" }
template <int I>
-void dep12(foo< (&I)[4] > *); // { dg-error "" "constant-expression" }
+void dep12(foo< (&I)[4] > *); // { dg-error "" "constant expression" }
diff --git a/gcc/testsuite/g++.dg/warn/overflow-warn-1.C b/gcc/testsuite/g++.dg/warn/overflow-warn-1.C
index a10e15b..995e7df 100644
--- a/gcc/testsuite/g++.dg/warn/overflow-warn-1.C
+++ b/gcc/testsuite/g++.dg/warn/overflow-warn-1.C
@@ -130,7 +130,7 @@ h2i (int x)
/* { dg-error "division by zero is not a constant.expression" "division" { target c++11 } 32 } */
/* { dg-warning "invalid conversion from" "convert" { target *-*-* } 56 } */
/* { dg-warning "invalid conversion from" "convert" { target c++11 } 58 } */
+/* { dg-error "division by zero is not a constant expression" "division" { target c++11 } 65 } */
/* { dg-error "is not a constant expression" "const" { target *-*-* } 65 } */
-/* { dg-error "division by zero is not a constant.expression" "division" { target c++11 } 65 } */
/* { dg-error "width not an integer constant" "bit.field" { target c++ } 32 } */
/* { dg-error "is not a constant expression" "division" { target c++ } 32 } */
diff --git a/gcc/testsuite/g++.dg/warn/overflow-warn-3.C b/gcc/testsuite/g++.dg/warn/overflow-warn-3.C
index c73a28c..6287959 100644
--- a/gcc/testsuite/g++.dg/warn/overflow-warn-3.C
+++ b/gcc/testsuite/g++.dg/warn/overflow-warn-3.C
@@ -65,7 +65,7 @@ g (int i)
switch (i)
{
case 0 * (1/0): /* { dg-warning "division by zero" } */
- ; /* { dg-error "is not a constant expression" "const" { target *-*-* } 67 } */
+ ; /* { dg-error "division by zero is not a constant expression" "division" { target c++11 } 67 } */
case 1 + 0 * (INT_MAX + 1): /* { dg-warning "integer overflow in expression" } */
/* { dg-warning "overflow in constant expression" "constant" { target *-*-* } 69 } */
;
@@ -131,6 +131,6 @@ h2i (int x)
/* { dg-error "division by zero is not a constant.expression" "division" { target c++11 } 19 } */
/* { dg-error "division by zero is not a constant.expression" "division" { target c++11 } 32 } */
/* { dg-warning "invalid conversion from" "convert" { target c++11 } 60 } */
-/* { dg-error "division by zero is not a constant.expression" "division" { target c++11 } 67 } */
+/* { dg-error "not a constant expression" "constant" { target *-*-*-* } 67 } */
/* { dg-error "width not an integer constant" "bit.field" { target c++ } 32 } */
/* { dg-error "is not a constant expression" "division" { target c++ } 32 } */
diff --git a/gcc/testsuite/g++.dg/warn/overflow-warn-4.C b/gcc/testsuite/g++.dg/warn/overflow-warn-4.C
index 23a2585..35f20b8 100644
--- a/gcc/testsuite/g++.dg/warn/overflow-warn-4.C
+++ b/gcc/testsuite/g++.dg/warn/overflow-warn-4.C
@@ -68,7 +68,7 @@ g (int i)
switch (i)
{
case 0 * (1/0): /* { dg-warning "division by zero" } */
- ; /* { dg-error "is not a constant expression" "const" { target *-*-* } 70 } */
+ ; /* { dg-error "division by zero is not a constant expression" "division" { target c++11 } 70 } */
case 1 + 0 * (INT_MAX + 1): /* { dg-warning "integer overflow in expression" } */
/* { dg-error "overflow in constant expression" "constant" { target *-*-* } 72 } */
;
@@ -134,6 +134,6 @@ h2i (int x)
/* { dg-error "division by zero is not a constant.expression" "division" { target c++11 } 19 } */
/* { dg-error "invalid conversion from" "convert" { target c++11 } 63 } */
/* { dg-error "division by zero is not a constant.expression" "division" { target c++11 } 34 } */
-/* { dg-error "division by zero is not a constant.expression" "division" { target c++11 } 70 } */
+/* { dg-error "is not a constant expression" "const" { target *-*-*-* } 70 } */
/* { dg-error "width not an integer constant" "bit.field" { target c++ } 34 } */
/* { dg-error "is not a constant expression" "division" { target c++ } 34 } */