[Bug c++/21008] New: Acess failure in accessing data member of base class from derived template class
$ uname -srm Linux 2.6.11.4 i686 $ g++ -v Reading specs from /opt/compilers/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/specs Configured with: ../gcc-3.4.3/configure --prefix=/opt/compilers/gcc-3.4.3 --enable-shared --enable-threads --enable-languages=c,c++ Thread model: posix gcc version 3.4.3 Copy and paste at prompt: $ cat > t.cpp << EOF struct A { protected: int foo_; }; template struct B : public A { }; template struct C : protected B { int foo () { return A::foo_; } }; EOF Compilation of the above with: $ g++ -c t.cpp results in: t.cpp: In member function `int C::foo()': t.cpp:4: error: object missing in reference to `A::foo_' t.cpp:17: error: from this location Thanks, Liviu -- Summary: Acess failure in accessing data member of base class from derived template class Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: nicoara at roguewave dot com CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21008
[Bug c++/32440] New: Lookup fails to find later function overload if template has been defined earlier
The following: $ cat t.cpp template< typename T > int baz (T const*) { return 0; } template void bar(T* ptr) { baz (*ptr); } int baz (int const&) { return 0; } void foo () { int const n = 0; bar (&n); } fails to compile with gcc 4.2.0: $ g++ -v; g++ -c t.cpp Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gcc-4.2.0/configure --prefix=/opt/compilers/gcc-4.2.0 --enable-threads --enable-shared --enable-languages=c,c++ Thread model: posix gcc version 4.2.0 t.cpp: In function 'void bar(T*) [with T = const int]': t.cpp:25: instantiated from here t.cpp:12: error: no matching function for call to 'baz(const int&)' Moving "int baz (int const&)" to top, or removing top function template avoids the error. It is possible that this issue may be somehow related to the issue reported in the bug report 31816. Thanks, Liviu -- Summary: Lookup fails to find later function overload if template has been defined earlier Product: gcc Version: 4.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: nicoara at roguewave dot com GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32440
[Bug c++/23088] New: gcc 4.0.1 rejects non-ambiguous member-template call
The following code: $ cat > t.cpp << EOF struct A { template T get () { return T(); } }; template T foo () { A a; return a.get (); } int main () { return foo (); } EOF fails to compile: $ g++ -c t.cpp t.cpp: In function `T foo()': t.cpp:13: error: parse error before `>' token with: $ gcc -v Reading specs from /usr/lib/gcc-lib/i486-slackware-linux/3.3.4/specs Configured with: ../gcc-3.3.4/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux --host=i486-slackware-linux Thread model: posix gcc version 3.3.4 -- Summary: gcc 4.0.1 rejects non-ambiguous member-template call Product: gcc Version: 4.0.1 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: nicoara at roguewave dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i486-slackware-linux GCC host triplet: i486-slackware-linux GCC target triplet: i486-slackware-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23088
[Bug c++/23088] gcc 4.0.1 rejects non-ambiguous member-template call
--- Additional Comments From nicoara at roguewave dot com 2005-07-26 21:34 --- I am sorry for the confusion, a mismatch between multiple versions of gcc led me to believe this was still a bug in 4.0.1. :-( -- What|Removed |Added Summary|gcc rejects non-ambiguous |gcc 4.0.1 rejects non- |member-template call|ambiguous member-template ||call Version|3.3.4 |4.0.1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23088