================
@@ -61,6 +61,24 @@ namespace cwg2819 { // cwg2819: 19 c++26
 #endif
 } // namespace cwg2819
 
+namespace cwg2823 { // cwg2823: no
+#if __cplusplus >= 201103L
+  constexpr int *p = 0;
+  constexpr int *q1 = &*p;
----------------
zygoloid wrote:

Agreed, the examples here are all valid in C and all invalid in C++, due to C 
[6.5.3.2](https://www.iso-9899.info/n3047.html#6.5.3.2)/3:

> The unary & operator yields the address of its operand. If the operand has 
> type "type", the result has
    type "pointer to type". If the operand is the result of a unary * operator, 
neither that operator nor
    the & operator is evaluated and the result is as if both were omitted, 
except that the constraints on
    the operators still apply and the result is not an lvalue. Similarly, if 
the operand is the result of a []
    operator, neither the & operator nor the unary * that is implied by the [] 
is evaluated and the result
    is as if the & operator were removed and the [] operator were changed to a 
+ operator. 

https://github.com/llvm/llvm-project/pull/165633
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to