summaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 5b5ec5483d1..9589b47dd64 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -733,7 +733,10 @@ finish_if_stmt_cond (tree cond, tree if_stmt)
if (IF_STMT_CONSTEXPR_P (if_stmt)
&& require_potential_rvalue_constant_expression (cond)
&& !value_dependent_expression_p (cond))
- cond = cxx_constant_value (cond, NULL_TREE);
+ {
+ cond = instantiate_non_dependent_expr (cond);
+ cond = cxx_constant_value (cond, NULL_TREE);
+ }
finish_cond (&IF_COND (if_stmt), cond);
add_stmt (if_stmt);
THEN_CLAUSE (if_stmt) = push_stmt_list ();
@@ -3493,7 +3496,7 @@ finish_id_expression (tree id_expression,
&& (!TYPE_P (scope)
|| (!dependent_type_p (scope)
&& !(identifier_p (id_expression)
- && IDENTIFIER_TYPENAME_P (id_expression)
+ && IDENTIFIER_CONV_OP_P (id_expression)
&& dependent_type_p (TREE_TYPE (id_expression))))))
{
/* If the qualifying type is non-dependent (and the name
@@ -4586,7 +4589,7 @@ handle_omp_array_sections_1 (tree c, tree t, vec<tree> &types,
}
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
- if (processing_template_decl)
+ if (processing_template_decl && TREE_CODE (t) != OVERLOAD)
return NULL_TREE;
if (DECL_P (t))
error_at (OMP_CLAUSE_LOCATION (c),
@@ -6106,7 +6109,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL
&& (!field_ok || TREE_CODE (t) != FIELD_DECL))
{
- if (processing_template_decl)
+ if (processing_template_decl && TREE_CODE (t) != OVERLOAD)
break;
if (DECL_P (t))
error ("%qD is not a variable in clause %qs", t,
@@ -6178,7 +6181,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
&& ((ort & C_ORT_OMP_DECLARE_SIMD) != C_ORT_OMP
|| TREE_CODE (t) != FIELD_DECL))
{
- if (processing_template_decl)
+ if (processing_template_decl && TREE_CODE (t) != OVERLOAD)
break;
if (DECL_P (t))
error ("%qD is not a variable in clause %<firstprivate%>", t);
@@ -6221,7 +6224,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
&& ((ort & C_ORT_OMP_DECLARE_SIMD) != C_ORT_OMP
|| TREE_CODE (t) != FIELD_DECL))
{
- if (processing_template_decl)
+ if (processing_template_decl && TREE_CODE (t) != OVERLOAD)
break;
if (DECL_P (t))
error ("%qD is not a variable in clause %<lastprivate%>", t);
@@ -6584,7 +6587,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
}
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
- if (processing_template_decl)
+ if (processing_template_decl && TREE_CODE (t) != OVERLOAD)
break;
if (DECL_P (t))
error ("%qD is not a variable in %<aligned%> clause", t);
@@ -6666,7 +6669,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
remove = true;
else if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
- if (processing_template_decl)
+ if (processing_template_decl && TREE_CODE (t) != OVERLOAD)
break;
if (DECL_P (t))
error ("%qD is not a variable in %<depend%> clause", t);
@@ -6797,7 +6800,7 @@ finish_omp_clauses (tree clauses, enum c_omp_region_type ort)
}
if (!VAR_P (t) && TREE_CODE (t) != PARM_DECL)
{
- if (processing_template_decl)
+ if (processing_template_decl && TREE_CODE (t) != OVERLOAD)
break;
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_MAP
&& (OMP_CLAUSE_MAP_KIND (c) == GOMP_MAP_POINTER