[patch] testsuite file fails concept-checks

Jonathan Wakely cow@compsoc.man.ac.uk
Tue May 18 01:02:00 GMT 2004


The __glibcxx_class_requires macro in include/ext/enc_filebuf.h is at
function scope.  This causes compilation errors in the ext/enc_filebuf
testsuite files when --enable-concept-checks is used since it expands to
a template definition at function scope, which is illegal. 

2004-05-18  Jonathan Wakely  <redi@gcc.gnu.org>

	* include/ext/enc_filebuf.h: Move concept-check macro to class scope.

OK for mainline and 3.4?

jon

N.B.
Most other classes in v3 state the concept requirements at the top of
the class definition, but in enc_filebuf the concept check uses a typedef
which isn't declared until the public part of the class body, so I put
the concept check at the end. I don't think this matters, since in this
case we're not checking a user-supplied template argument but
std::__enc_traits, so visibility of the check isn't important.

-------------- next part --------------
Index: include/ext/enc_filebuf.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/ext/enc_filebuf.h,v
retrieving revision 1.4
diff -u -p -r1.4 enc_filebuf.h
--- include/ext/enc_filebuf.h	9 Dec 2003 04:31:53 -0000	1.4
+++ include/ext/enc_filebuf.h	18 May 2004 00:12:55 -0000
@@ -57,9 +57,12 @@ namespace __gnu_cxx
 	// Set state type to something useful.
 	// Something more than copyconstructible is needed here, so
 	// require default and copy constructible + assignment operator.
-	__glibcxx_class_requires(state_type, _SGIAssignableConcept);
 	this->_M_state_beg = __state;
 	this->_M_state_beg._M_init();
       };
+
+    private:
+      // concept requirements
+      __glibcxx_class_requires(state_type, _SGIAssignableConcept)
     };
 } // namespace __gnu_cxx


More information about the Gcc-patches mailing list