public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28836]  New: gcc 4.1.1 rejects possible valid code containing the "using" keyword
@ 2006-08-24 14:48 wernervangeit at hotmail dot com
  2006-08-24 14:57 ` [Bug c++/28836] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: wernervangeit at hotmail dot com @ 2006-08-24 14:48 UTC (permalink / raw)
  To: gcc-bugs

A third-party library I'm using doesn't compile with gcc 4.1.1 anymore (it
still did with 4.0). The problem is that some header files contain a code
fragment (I've stripped it down) like this:
#include <iostream>

using namespace std;

template <class F, class R> class I {
    public:
        int size;
};

template <class T> class D : private I<T, double> {
    using D< T >::size;
}; 

int main() {
    D<double> test;
    cout << "Hello world" << endl;
}

gcc 4.1.1 generates the following error:

test.cpp: In instantiation of 'D<double>':
test.cpp:15:   instantiated from here
test.cpp:11: error: type 'D<double>' is not a base type for type 'D<double>'

gcc 4.0 doesn't see any problem.

I'm not sure this kind of construct is valid. If "using D< T >::size;" is
replaced by "using I< T, double >::size;" gcc 4.1.1 is happy again.

My system is Mac OS X 10.4.7 (PowerPC). 
gcc was compiled with darwinports:

"Using built-in specs.
Target: powerpc-apple-darwin8.7.0
Configured with: ../gcc-4.1.1/configure --prefix=/opt/local
--enable-languages=c,c++,java,objc,obj-c++,fortran
--libdir=/opt/local/lib/gcc41 --includedir=/opt/local/include/gcc41
--infodir=/opt/local/share/info --mandir=/opt/local/share/man
--with-local-prefix=/opt/local --with-system-zlib --disable-nls
--program-suffix=-dp-4.1 --with-gxx-include-dir=/opt/local/include/gcc41/c++/
--with-gmp=/opt/local --with-mpfr=/opt/local --with-as=/opt/local/bin/odas
--with-ld=/opt/local/bin/odld --with-ar=/opt/local/bin/odar --disable-multilib
Thread model: posix
gcc version 4.1.1
"
The command used to compile was simply "g++ test.cpp"

The library that contains the code fragments is EO (Evolutionary algorithms,
http://www2.lifl.fr/~cahon/paradisEO/eo/index.html)

Thx,

Werner Van Geit


-- 
           Summary: gcc 4.1.1 rejects possible valid code containing the
                    "using" keyword
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wernervangeit at hotmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28836


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/28836] gcc 4.1.1 rejects possible valid code containing the "using" keyword
  2006-08-24 14:48 [Bug c++/28836] New: gcc 4.1.1 rejects possible valid code containing the "using" keyword wernervangeit at hotmail dot com
@ 2006-08-24 14:57 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-24 14:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-08-24 14:57 -------
4.0.x was incorrect in accepting this code in the first place.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28836


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-24 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-24 14:48 [Bug c++/28836] New: gcc 4.1.1 rejects possible valid code containing the "using" keyword wernervangeit at hotmail dot com
2006-08-24 14:57 ` [Bug c++/28836] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).