On 11/10/2011 01:43 AM, Jason Merrill wrote:
On 11/09/2011 05:45 PM, Paolo Carlini wrote:
finish_id_expression is called from cp_parser_primary_expression with a
true allow_non_integral_constant_expression_p and the error doesn't
occur.

Yes, allow_non_integral_constant_expression_p should always be true in C++11.
Ah, good (sorry about the badly formatted code, by the way). Now, if I apply the patchlet below, I get this error for template/nontype13.C:

nontype13.C:14:5: error: could not convert template argument ‘((Dummy<int>*)this)->Dummy<T>::evil<int>’ to ‘bool’

compared to the current:

nontype13.C:14:5: error: ‘void Dummy<T>::evil() [with T = int]’ cannot appear in a constant-expression

Seems some sort of diagnostic quality regression...

By the way, before receiving your feedback, I was also wondering if the tsubst_expr calls for STATIC_ASSERT should really pass true as integral_constant_expression_p...

Paolo.

/////////////////////
Index: pt.c
===================================================================
--- pt.c        (revision 181246)
+++ pt.c        (working copy)
@@ -13233,7 +13233,7 @@ tsubst_copy_and_build (tree t,
        decl = finish_id_expression (t, decl, NULL_TREE,
                                     &idk,
                                     integral_constant_expression_p,
-                                    
/*allow_non_integral_constant_expression_p=*/false,
+                                    
/*allow_non_integral_constant_expression_p=*/true,
                                     &non_integral_constant_expression_p,
                                     /*template_p=*/false,
                                     /*done=*/true,

Reply via email to