<div class="gmail_quote">On Mon, Jul 23, 2012 at 8:39 AM, Jordan Rose <span dir="ltr"><<a href="mailto:jordan_rose@apple.com" target="_blank">jordan_rose@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
[dcl.constexpr]p9: A constexpr specifier used in an object declaration declares the object as const.<br>
<br>
[dcl.type]p2: const can be combined with any type specifier except itself.<br>
<br>
I could see how GCC could interpret that as meaning "constexpr replaces const", but I think Clang is doing the right thing by allowing both specifiers. The constexpr's "declaring the object as const" is a semantic property, not an implicit inclusion of the const /specifier/.<br>

<br>
I'm still not a standardista, though, so someone might have another view (or another citation I missed).<br></blockquote><div><br></div><div><div>Yes, I came to the same conclusion. [dcl.type]p2 is talking only about the type-specifiers which appear in the decl-specifier-seq. [dcl.constexpr]p9 is clearly not saying we should act as if 'const' appeared in the decl-specifier-seq, since in this case, the constexpr implies a const on p, not on *p:</div>
<div><br></div><div>constexpr const char *p = 0;</div><div><br></div><div>The relevant rule seems to be [<a href="http://dcl.type.cv">dcl.type.cv</a>]p1: "Redundant cv-qualifications are ignored."</div><div><br></div>
<div>Hence I believe this is a GCC bug.</div></div></div>