On 3/11/20 2:28 PM, Tobias Burnus wrote:
Like for Fortran, it also fixes some other issues – here for C++
related to namespaces. (For class, see PR c++/94140.)
Test case of the PR yields an ICE in the middle end and the
namespace tests an ICE in cc1plus. Additionally, invalid code
is not diagnosed.
The OpenACC spec has under "Declare Directive" has the following
"A declare directive must be in the same scope
as the declaration of any var that appears in
the data clauses of the directive."
("A declare directive is used […] following a variable
declaration in C or C++".)
NOTE for C++: This patch assumes that variables in a namespace
are handled in the same way as those which are at
global (namespace) scope; however, the OpenACC specification's
wording currently is "In C or C++ global scope, only …".
Hence, one can argue about this part of the patch; but as
it fixes an ICE and is a very sensible extension – the other
option is to reject it – I believe it is fine.
(On the OpenACC side, this is now Issue 288.)
OK for the trunk?
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander