]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++ frontend: check for missing condition for novector [PR115623]
authorTamar Christina <tamar.christina@arm.com>
Thu, 4 Jul 2024 10:01:55 +0000 (11:01 +0100)
committerTamar Christina <tamar.christina@arm.com>
Thu, 4 Jul 2024 10:01:55 +0000 (11:01 +0100)
commit84acbfbecbdbc3fb2a395bd97e338b2b26fad374
tree9ab84890ffda1017ac737d24ca84a22dbc3739ed
parent236d6fef2479654b3011f8208e1bd7f078700109
c++ frontend: check for missing condition for novector [PR115623]

It looks like I forgot to check in the C++ frontend if a condition exist for the
loop being adorned with novector.  This causes a segfault because cond isn't
expected to be null.

This fixes it by issuing ignoring the pragma when there's no loop condition
the same way we do in the C frontend.

gcc/cp/ChangeLog:

PR c++/115623
* semantics.cc (finish_for_cond): Add check for C++ cond.

gcc/testsuite/ChangeLog:

PR c++/115623
* g++.dg/vect/vect-novector-pragma_2.cc: New test.
gcc/cp/semantics.cc
gcc/testsuite/g++.dg/vect/vect-novector-pragma_2.cc [new file with mode: 0644]