Bug 29486 - call of friend template is ambiguous
Summary: call of friend template is ambiguous
Status: RESOLVED DUPLICATE of bug 29236
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on: 29236 29438
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-16 17:26 UTC by Peter Kümmel
Modified: 2006-10-20 07:33 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Known to work: 2.95.3
Known to fail: 3.2.3 4.0.2 4.1.2 4.2.0
Last reconfirmed:


Attachments
demo: g++ bug.cpp (6.89 KB, text/plain)
2006-10-16 17:40 UTC, Peter Kümmel
Details
mingw-gcc crash (7.64 KB, text/plain)
2006-10-16 20:59 UTC, Peter Kümmel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kümmel 2006-10-16 17:26:31 UTC
While moving the definition of a friend template out of the class definition I found this error.

Please compile the attached file and have a look at the ReleaseAll function.

The file is part of Loki.
Comment 1 Peter Kümmel 2006-10-16 17:40:51 UTC
Created attachment 12447 [details]
demo: g++ bug.cpp
Comment 2 Andrew Pinski 2006-10-16 20:07:14 UTC
Quickly looking at the source, I think this is the same as PR 29438 and PR 29236.
Comment 3 Peter Kümmel 2006-10-16 20:53:16 UTC
Comeau compiles it, but vc8 also fails.
Comment 4 Peter Kümmel 2006-10-16 20:59:54 UTC
Created attachment 12448 [details]
mingw-gcc crash

Here another file which does not compile.

On Windows gcc even crashs:

bug2.cpp: In function `void friend_handling()':
bug2.cpp:1626: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.

Reading specs from c:/programme/mingw/bin/../lib/gcc/mingw32/3.4.5/specs
Configured with: ../gcc-3.4.5/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/min
gw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --ena
ble-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-in
terpreter --enable-hash-synchronization --enable-libstdcxx-debug
Thread model: win32
gcc version 3.4.5 (mingw special)


And cygwin:

Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/
usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,ada,c++,d,f77,java,objc
--enable-nls --without-included-gettext --enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java-awt
 --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-threads=posix --enable-java-gc=boehm --disable-win32
-registry --enable-sjlj-exceptions --enable-hash-synchronization --enable-libstdcxx-debug : (reconfigured)
Thread model: posix
gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
Comment 5 Peter Kümmel 2006-10-16 21:09:17 UTC
bug2.cpp: 4.0.1 and 20061010 doesn't crash.
Comment 6 Peter Kümmel 2006-10-16 21:18:54 UTC
(In reply to comment #2)
> Quickly looking at the source, I think this is the same as PR 29438 and PR
> 29236.
> 

Yes, this is possible, allways template templates are used as template parameter.
Comment 7 Andrew Pinski 2006-10-20 07:33:42 UTC
Yes this is a dup of bug 29236.

*** This bug has been marked as a duplicate of 29236 ***