summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-22 12:17:15 +0000
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>2014-05-22 12:17:15 +0000
commit3c82ff7f84cb0f1223d825e5196643e39cdf1a5f (patch)
treeed6c9870c1f5cf0786a0bc5e8770bca7213ead2f
parent8207b6a22d5955c41109399cb09f0af661a593ea (diff)
downloadgcc-3c82ff7f84cb0f1223d825e5196643e39cdf1a5f.tar.gz
cp:
PR c/61271 * cp-array-notation.c (cilkplus_an_triplet_types_ok_p): Fix condition. testsuite: PR c/61271 * g++.dg/cilk-plus/AN/array_function.cc: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210804 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/cp-array-notation.c4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cilk-plus/AN/array_function.cc8
4 files changed, 20 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d90e6e3bf90..2021e2df26e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-21 Jonathan Wakely <jwakely@redhat.com>
+
+ PR c/61271
+ * cp-array-notation.c (cilkplus_an_triplet_types_ok_p): Fix condition.
+
2014-05-21 Ville Voutilainen <ville.voutilainen@gmail.com>
PR c++/61133
diff --git a/gcc/cp/cp-array-notation.c b/gcc/cp/cp-array-notation.c
index 0ff0967d363..ff82deee7be 100644
--- a/gcc/cp/cp-array-notation.c
+++ b/gcc/cp/cp-array-notation.c
@@ -26,7 +26,7 @@
An array notation expression has 4 major components:
1. The array name
2. Start Index
- 3. Number of elements we need to acess (we call it length)
+ 3. Number of elements we need to access (we call it length)
4. Stride
So, if we have something like A[0:5:2], we are accessing A[0], A[2], A[4],
@@ -1418,7 +1418,7 @@ cilkplus_an_triplet_types_ok_p (location_t loc, tree start_index, tree length,
error_at (loc, "stride of array notation triplet is not an integer");
return false;
}
- if (!TREE_CODE (type) == FUNCTION_TYPE)
+ if (TREE_CODE (type) == FUNCTION_TYPE)
{
error_at (loc, "array notation cannot be used with function type");
return false;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0641f59884e..1b9c60ac284 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-21 Jonathan Wakely <jwakely@redhat.com>
+
+ PR c/61271
+ * g++.dg/cilk-plus/AN/array_function.cc: New.
+
2014-05-22 Richard Biener <rguenther@suse.de>
* gcc.dg/tree-ssa/alias-33.c: New testcase.
diff --git a/gcc/testsuite/g++.dg/cilk-plus/AN/array_function.cc b/gcc/testsuite/g++.dg/cilk-plus/AN/array_function.cc
new file mode 100644
index 00000000000..b111e217cfc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/AN/array_function.cc
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-fcilkplus" } */
+
+void f() { }
+int main()
+{
+ f[0:1:1]; // { dg-error "function type" }
+}