This is the mail archive of the gcc@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]

[3.4] Incomplete types and template definitions


Compiler behavior in this area changed, and this should be documented.
(The last Xerces 2.3.0 exhibits this change, for example.)

Is this patch okay?  (I'm not too familiar with the correct C++
terminology.)  Shall I quote the GCC error message?  (The other
examples don't do this.)

The example below results in duplicate error messages.  I'm going to
file a separate bug report for that (if it's not known so far).

--- changes.html.~1.47.~	2003-09-11 21:31:06.000000000 +0200
+++ changes.html	2003-09-18 15:52:27.000000000 +0200
@@ -122,6 +122,21 @@
 	  this->g ();
 	}</pre></li>
 
+    <li>Also in a template definition, GCC used to accept certain
+    references to incomplete types, as long as the type is not
+    incomplete at the time of template instantiation.  For example,
+    the following code was accepted:
+        <pre>
+         struct Foo;
+         template &lt;class X&gt; struct Bar {
+           void bar(Foo, struct Foo* baz)
+           {
+             baz-&gt;foo();
+           }
+         };
+         struct Foo { void foo(); };
+         Bar&lt;int&gt; bar;</pre></li>
+
     <li>The "named return value" and "implicit typename"
 	extensions have been removed.</li>
 	    


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