[date_time] error with g++-4.3.2

Using 1.37.0 on x86_64-pc-linux. I get the following error compiling a program that includes date_time.hpp with g++-4.3.2. The web site says that g++ 4.3.2 is tested for 1.37.0. Any clue? In file included from boost/date_time/local_time/tz_database.hpp:14, from boost/date_time/local_time/local_time.hpp:19, from boost/date_time.hpp:15, boost/date_time/tz_db_base.hpp:161: error: declaration of 'typedef class boost::date_time::dst_adjustment_offsets<typename time_zone_type::time_duration_type> boost::date_time::tz_db_base<time_zone_type, rule_type>::dst_adjustment_offsets' boost/date_time/time_zone_base.hpp:76: error: changes meaning of 'dst_adjustment_offsets' from 'class boost::date_time::dst_adjustment_offsets<typename time_zone_type::time_duration_type>' no particular error building boost; final message is only: ...updated 7627 targets... Frédéric Bron ___________________________________ Frédéric Bron (frederic.bron@alcan.com) Unité ALT, Alcan CRV, BP 27, 38341 Voreppe +33 4 76 57 81 72, +33 6 07 48 56 67 Avis : Ce message et toute pièce jointe sont la propriété d'Alcan et sont destinés seulement aux personnes ou à l'entité à qui le message est adressé. Si vous avez reçu ce message par erreur, veuillez le détruire et en aviser l'expéditeur par courriel. Si vous n'êtes pas le destinataire du message, vous n'êtes pas autorisé à utiliser, à copier ou à divulguer le contenu du message ou ses pièces jointes en tout ou en partie. Notice: This message and any attachments are the property of Alcan and are intended solely for the named recipients or entity to whom this message is addressed. If you have received this message in error please inform the sender via e-mail and destroy the message. If you are not the intended recipient you are not allowed to use, copy or disclose the contents or attachments in whole or in part.

boost-users-bounces@lists.boost.org a écrit sur 07/01/2009 13:37:18 :
In file included from boost/date_time/local_time/tz_database.hpp:14, from boost/date_time/local_time/local_time.hpp:19, from boost/date_time.hpp:15, boost/date_time/tz_db_base.hpp:161: error: declaration of 'typedef class boost::date_time::dst_adjustment_offsets<typename time_zone_type::time_duration_type> boost::date_time::tz_db_base<time_zone_type, rule_type>:: dst_adjustment_offsets' boost/date_time/time_zone_base.hpp:76: error: changes meaning of 'dst_adjustment_offsets' from 'class boost::date_time:: dst_adjustment_offsets<typename time_zone_type::time_duration_type>'
Here is the code that gives an error: namespace boost { namespace date_time { template<class time_duration_type> class dst_adjustment_offsets { } ; // in date_time/time_zone_base.hpp template<class time_zone_type, class rule_type> class tz_db_base { // in date_time/tz_db_base.hpp typedef dst_adjustment_offsets<time_duration_type> dst_adjustment_offsets; } ; } I do not understand clearly if this should be allowed (i.e. to give a typedef the same name of a class template) but the standard (2003) says: 7.1.3 The typedef specifier [dcl.typedef] §2: In a given non-class scope, a typedef specifier can be used to redefine the name of any type declared in that scope to refer to the type to which it already refers. [Example: typedef struct s { /* ... */ } s; typedef int I; typedef int I; typedef I I; —end example] but we are in a class scope §3: In a given scope, a typedef specifier shall not be used to redefine the name of any type declared in that scope to refer to a different type. [Example: class complex { /* ... */ }; typedef int complex; // error: redefinition —end example] Similarly, in a given scope, a class or enumeration shall not be declared with the same name as a typedef-name that is declared in that scope and refers to a type other than the class or enumeration itself. [Example: typedef int complex; class complex { /* ... */ }; // error: redefinition —end example] are we in the same scope? F. Bron Avis : Ce message et toute pièce jointe sont la propriété d'Alcan et sont destinés seulement aux personnes ou à l'entité à qui le message est adressé. Si vous avez reçu ce message par erreur, veuillez le détruire et en aviser l'expéditeur par courriel. Si vous n'êtes pas le destinataire du message, vous n'êtes pas autorisé à utiliser, à copier ou à divulguer le contenu du message ou ses pièces jointes en tout ou en partie. Notice: This message and any attachments are the property of Alcan and are intended solely for the named recipients or entity to whom this message is addressed. If you have received this message in error please inform the sender via e-mail and destroy the message. If you are not the intended recipient you are not allowed to use, copy or disclose the contents or attachments in whole or in part.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 07 January 2009 11:15 am, frederic.bron@alcan.com wrote:
Here is the code that gives an error:
namespace boost { namespace date_time {
template<class time_duration_type> class dst_adjustment_offsets { } ; // in date_time/time_zone_base.hpp
template<class time_zone_type, class rule_type> class tz_db_base { // in date_time/tz_db_base.hpp typedef dst_adjustment_offsets<time_duration_type> dst_adjustment_offsets; } ;
FYI this bug looks like it was fixed in svn trunk with revision 49505 and in the release branch in revision 49705, by fully qualifying the typedef in tz_db_base. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFJZNm15vihyNWuA4URAomfAJ9ODz/ILAk36dqwczBF8COTWDG31QCgjNOG wCviIe+ur5BsgqCgpGsLqUA= =NSMt -----END PGP SIGNATURE-----

FYI this bug looks like it was fixed in svn trunk with revision 49505 and in the release branch in revision 49705, by fully qualifying the typedef in tz_db_base.
Is there a patch for 1.37.0? Frédéric Avis : Ce message et toute pièce jointe sont la propriété d'Alcan et sont destinés seulement aux personnes ou à l'entité à qui le message est adressé. Si vous avez reçu ce message par erreur, veuillez le détruire et en aviser l'expéditeur par courriel. Si vous n'êtes pas le destinataire du message, vous n'êtes pas autorisé à utiliser, à copier ou à divulguer le contenu du message ou ses pièces jointes en tout ou en partie. Notice: This message and any attachments are the property of Alcan and are intended solely for the named recipients or entity to whom this message is addressed. If you have received this message in error please inform the sender via e-mail and destroy the message. If you are not the intended recipient you are not allowed to use, copy or disclose the contents or attachments in whole or in part.

frederic.bron@alcan.com wrote:
FYI this bug looks like it was fixed in svn trunk with revision 49505 and in the release branch in revision 49705, by fully qualifying the typedef in tz_db_base.
Is there a patch for 1.37.0?
Edit the file boost/date_time/tz_db_base.hpp as follows: - typedef dst_adjustment_offsets<time_duration_type> dst_adjustment_offsets; + typedef boost::date_time::dst_adjustment_offsets<time_duration_type> dst_adjustment_offsets;
Frédéric
Avis : Ce message et toute pièce jointe sont la propriété d'Alcan et sont destinés seulement aux personnes ou à l'entité à qui le message est adressé. Si vous avez reçu ce message par erreur, veuillez le détruire et en aviser l'expéditeur par courriel. Si vous n'êtes pas le destinataire du message, vous n'êtes pas autorisé à utiliser, à copier ou à divulguer le contenu du message ou ses pièces jointes en tout ou en partie.
Notice: This message and any attachments are the property of Alcan and are intended solely for the named recipients or entity to whom this message is addressed. If you have received this message in error please inform the sender via e-mail and destroy the message. If you are not the intended recipient you are not allowed to use, copy or disclose the contents or attachments in whole or in part.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Dmitry V. Krivenok
-
Frank Mori Hess
-
frederic.bron@alcan.com