On Tue, 7 Feb 2017, Marek Polacek wrote: > Fixed. Here is a small follow-up patch that I applied on top of this.
It uses <blockquote>, improves markup, and simplifies language a bit. (Note that if we have "member" is a meta-variable, then we also need to mark it up as "<i>member</i>" whenever we refer to it.) Gerald Index: gcc-7/porting_to.html =================================================================== RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-7/porting_to.html,v retrieving revision 1.8 diff -u -r1.8 porting_to.html --- gcc-7/porting_to.html 13 Feb 2017 13:43:29 -0000 1.8 +++ gcc-7/porting_to.html 25 Feb 2017 16:38:14 -0000 @@ -36,11 +36,11 @@ <h3 id="hypothetical-instantiation">Stricter rules when using templates</h3> <p> -GCC 7 no longer accepts various ill-formed code involving use of templates. -The C++ standard says: +GCC 7 no longer accepts various ill-formed constructs involving the use +of templates. The C++ standard says: </p> -<p><em> +<blockquote> 14.6/8: "If a hypothetical instantiation of a template immediately following its definition would be ill-formed due to a construct that does not depend on a template parameter, the program is ill-formed; no @@ -48,12 +48,13 @@ the hypothetical instantiation is different from the interpretation of the corresponding construct in any actual instantiation of the template, the program is ill-formed; no diagnostic is required." -</em></p> +</blockquote> <p> As a consequence, the following examples are invalid and G++ will no longer -compile them, because G++ used to treat <code>this-><i>member</i></code> -where member has a non-dependent type, as type-dependent, and now it doesn't. +compile them. G++ used to treat <code>this-><i>member</i></code>, +where <i>member</i> has a non-dependent type, as type-dependent and +no longer does. </p> <pre><code> @@ -65,7 +66,7 @@ void fn2() { fn1().x; } }; </code></pre> -will result in +results in <blockquote><pre> <span class="boldred">error:</span> invalid use of incomplete type <b>'struct C'</b> </pre></blockquote> @@ -78,7 +79,7 @@ void fn1() { foo (this->x); } }; </code></pre> -will result in +results in <blockquote><pre> <span class="boldred">error:</span> there are no arguments to <b>'foo'</b> that depend on a template parameter, so a declaration of <b>'foo'</b> must be available </pre></blockquote> @@ -91,12 +92,12 @@ void fn1() { this->a[0]; } }; </code></pre> -will result in +results in <blockquote><pre> <span class="boldred">error:</span> <b>'void*'</b> is not a pointer-to-object type </pre></blockquote> -because there's no instantiation of that template that can be valid, it will -always dereference a <code>void*</code>. +because there is no instantiation of that template that can be valid; it +will always dereference a <code>void*</code>. <h3 id="conversion-op-mangling">Mangling change for conversion operators</h3>