Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 113488 - net-libs/wvstreams-4.0.2-r1 gcc41 patch
Summary: net-libs/wvstreams-4.0.2-r1 gcc41 patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: High normal
Assignee: C++ Team [disbanded]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-24 10:38 UTC by Gene Seto
Modified: 2005-11-27 22:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to fix compile errors (wvstreams-4.0.2-gcc41.patch,698 bytes, patch)
2005-11-24 10:39 UTC, Gene Seto
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gene Seto 2005-11-24 10:38:09 UTC
compile fails. 

Reproducible: Always
Steps to Reproduce:
1. Compile wvstreams-4.0.2-r1 with gcc41

Actual Results:  
compile failure

Expected Results:  
compiled and installed
Comment 1 Gene Seto 2005-11-24 10:39:40 UTC
Created attachment 73511 [details, diff]
patch to fix compile errors
Comment 2 Mark Loeser (RETIRED) gentoo-dev 2005-11-25 20:18:34 UTC
This looks good to me.

Gene: Did you send the patch upstream?

Alin: Could you apply this please?
Comment 3 Alin Năstac (RETIRED) gentoo-dev 2005-11-26 02:37:31 UTC
fixed in -r2
however, it looks strange to me that gcc-4.1 don't accept the original version
as valid syntax.
Comment 4 Ciaran McCreesh 2005-11-26 09:07:20 UTC
It's not valid syntax...

From [class.ctor]:

1 Constructors do not have names.  A special declarator  syntax using an
  optional function-specifier (_dcl.fct.spec_) followed by the construc-
  tor's  class  name  followed by a parameter list is used to declare or
  define the constructor.  In such a declaration,  optional  parentheses
  around the constructor class name are ignored.  [Example:
          class C {
          public:
                  C();       // declares the constructor
          };

          C::C() { }         // defines the constructor
   --end example]

From [class.dtor]:

1 A  special  declarator  syntax  using  an  optional function-specifier
  (_dcl.fct.spec_) followed by ~ followed by the destructor's class name
  followed  by an empty parameter list is used to declare the destructor
  in a class definition.  In such a declaration, the ~ followed  by  the
  destructor's  class name can be enclosed in optional parentheses; such
  parentheses are ignored.  A typedef-name  that  names  a  class  is  a
  class-name (_dcl.typedef_); however, a typedef-name that names a class
  shall not be used as the identifier in the declarator for a destructor
  declaration.
Comment 5 Alin Năstac (RETIRED) gentoo-dev 2005-11-27 00:01:43 UTC
really? then the rest of C++ compilers must be broken if they accept:
          class C {
          public:
                  C::C();       // declares the constructor
          };
someone should break the news to the rest of the world. 
Comment 6 Ciaran McCreesh 2005-11-27 09:26:37 UTC
You can do lots of illegal things in most C++ compilers. This isn't exactly the
only example of "stuff you can get away with in some compilers that isn't
strictly legal". Problem is, sooner or later someone might fix the compiler -- I
bet we'll get a whole load more of this kind of thing when g++4 starts to become
more widely used.
Comment 7 Ciaran McCreesh 2005-11-27 09:29:34 UTC
...and it looks like this generates a warning in icc:

warning #470: qualified name is not allowed in member declaration

...and an error in Comeau:

error: qualified name is not allowed in member declaration

Definitely a code bug, not a compiler bug.
Comment 8 Alin Năstac (RETIRED) gentoo-dev 2005-11-27 22:06:10 UTC
interesting... do you have a quote from ANSI C++ standard that specifies
qualified names are not allowed in member declarations?
Comment 9 Alin Năstac (RETIRED) gentoo-dev 2005-11-27 22:25:20 UTC
ok, I've found it in JTC1.22.32 - ISO/IEC 14882 - Programming language C++ draft
October 2005, paragraph 8.3.