Yes, this violates a strict alias. You are accessing an object d type double , although the pointer is nptr , which is not a pointer to double or any type associated with it.
Just because the compiler does not generate a warning does not mean that it is not a violation. Severe violations are UB (because they are a matter of behavior during operation) and therefore do not require diagnostics.
source share