================
@@ -309,10 +309,10 @@ constexpr const int *V81 = &V80;
 constexpr int *V82 = 0;
 constexpr int *V83 = V82;
 constexpr int *V84 = 42;
-// both-error@-1 {{constexpr variable 'V84' must be initialized by a constant 
expression}}
-// both-note@-2 {{this conversion is not allowed in a constant expression}}
-// both-error@-3 {{constexpr pointer initializer is not null}}
+// both-error@-1 {{constexpr pointer initializer is not null}}
 constexpr int *V85 = nullptr;
+constexpr int *V91 = 0.;
----------------
SamrudhNelli wrote:

Sure, but won't it be redundant as `0e0` and `0x0p0` are treated as double?
Unfortunately, I don't have commit access to the repository and can't implement 
the changes suggested. I would be okay if anyone with commit access adds the 
test cases. I feel that would be a better and faster approach rather than me 
opening another PR just for this.
Open to suggestions.

```
constexpr int *V92 = 0.0f;
// expected-error@-1 {{initializing 'int *const' with an expression of 
incompatible type 'float'}}
constexpr int *V93 = 0e0;
// expected-error@-1 {{initializing 'int *const' with an expression of 
incompatible type 'double'}}
constexpr int *V94 = 0x0p0;
// expected-error@-1 {{initializing 'int *const' with an expression of 
incompatible type 'double'}}
```

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

Reply via email to