summaryrefslogtreecommitdiff
path: root/gcc/cp/cp-array-notation.c
diff options
context:
space:
mode:
authorkyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-30 08:14:39 +0000
committerkyukhin <kyukhin@138bc75d-0d04-0410-961f-82ee72b054a4>2014-06-30 08:14:39 +0000
commit4879e4cf54d85af5c8273bcc4110fae1cf549093 (patch)
tree2e4504fc8ce8686b549beea65a739e937e8ec9bb /gcc/cp/cp-array-notation.c
parent2f49a7a00437bd380e305cd518611422ce03af9c (diff)
downloadgcc-4879e4cf54d85af5c8273bcc4110fae1cf549093.tar.gz
PR middle-end/57541
gcc/c/ * c-array-notation.c (fix_builtin_array_notation_fn): Check for 0 arguments in builtin call. Check that bultin argument is correct. * c-parser.c (c_parser_array_notation): Check for incorrect initial index. gcc/cpp/ * cp-array-notation.c (expand_sec_reduce_builtin): Check that bultin argument is correct. * call.c (build_cxx_call): Check for 0 arguments in builtin call. gcc/testsuite/ * c-c++-common/cilk-plus/AN/pr57541.c: New case added. * c-c++-common/cilk-plus/AN/pr57541-2.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212138 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cp-array-notation.c')
-rw-r--r--gcc/cp/cp-array-notation.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/cp-array-notation.c b/gcc/cp/cp-array-notation.c
index 0538e559f85..b45449bc44d 100644
--- a/gcc/cp/cp-array-notation.c
+++ b/gcc/cp/cp-array-notation.c
@@ -250,7 +250,10 @@ expand_sec_reduce_builtin (tree an_builtin_fn, tree *new_var)
if (!find_rank (location, an_builtin_fn, an_builtin_fn, true, &rank))
return error_mark_node;
if (rank == 0)
- return an_builtin_fn;
+ {
+ error_at (location, "Invalid builtin arguments");
+ return error_mark_node;
+ }
else if (rank > 1
&& (an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MAX_IND
|| an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND))