This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: document 3.4 changes


Nathan Sidwell <nathan@codesourcery.com> writes:

[...]

| + 	template &lt;typename T&gt; struct C : B&lt;T&gt; {
| + 	  void g ()
| + 	  {
| + 	    m = 0; // error
| + 	    f ();  // error
| + 	    n = 0; // ::n is modified
| + 	    g ();  // ::g is called
| + 	  }
| + 	};</pre>
| +         You must explicitly qualify the name. Here is the corrected
| +         definition of <code>C&lt;T&gt;::g</code>,
| + 	<pre>
| + 	template &lt;typename T&gt; void C<T>::g ()
| + 	{
| + 	  this->m = 0;
| + 	  this->f ();
| + 	  this->n = 0
| + 	  this->g ();
| + 	}</pre>

This hunk is misleading.  Explicilty "qualifying names" means put a
nested-name-specifier in front of the identifier, i.e. something like 
C::m, C::g, which obviously is not what is descrived above.

How about

   You would need to make the names dependent by putting "this->" in
   front of them.

Our documentation already contains wording about dependent names and such.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]