This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49418] openmp default(none) in template function
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Jun 2011 13:32:45 +0000
- Subject: [Bug c++/49418] openmp default(none) in template function
- Auto-submitted: auto-generated
- References: <bug-49418-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49418
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-21 13:32:06 UTC ---
The problem seems to be that x has T const type before instantiation, but
int (without const) after instantiation.
The spot where the const is lost is:
type = type_decays_to (type);
TREE_TYPE (r) = type;
cp_apply_type_quals_to_decl (cp_type_quals (type), r);
Does C++ really mandate stripping the toplevel qualifiers from the PARM_DECLs
here? It isn't stripped from VAR_DECLs.
OpenMP 2.5/OpenMP 3.0 says that const qualified parameters and variables are
predetermined shared. While it hopefully changes in some way in OpenMP 3.1
(though, the current 3.1 draft wording is likely to change, as it is backwards
incompatible with default(none)), for older standards the presence/lack of
const
makes a big difference.