Skip to content

Rule: Return pointee gained const

Canonical rule slug: return-pointee-gained-const. ← back to all rules

A function returning a pointer gains const on the pointee -- binary-identical, but callers that store the result in a non-const pointer no longer compile.

Canonical demonstration