public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/45601]  New: explicit template instanciation problem
@ 2010-09-08 16:30 stephane at magnenat dot net
  2010-09-08 16:31 ` [Bug c++/45601] " stephane at magnenat dot net
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: stephane at magnenat dot net @ 2010-09-08 16:30 UTC (permalink / raw)
  To: gcc-bugs

The explicit template instantiation fails. As far as I can find on the net, it
should work. See attached minimal test case.


-- 
           Summary: explicit template instanciation problem
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: stephane at magnenat dot net
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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


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

* [Bug c++/45601] explicit template instanciation problem
  2010-09-08 16:30 [Bug c++/45601] New: explicit template instanciation problem stephane at magnenat dot net
  2010-09-08 16:31 ` [Bug c++/45601] " stephane at magnenat dot net
@ 2010-09-08 16:31 ` stephane at magnenat dot net
  2010-09-08 16:44 ` [Bug c++/45601] explicit template instantiation problem paolo dot carlini at oracle dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: stephane at magnenat dot net @ 2010-09-08 16:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from stephane at magnenat dot net  2010-09-08 16:30 -------
Created an attachment (id=21741)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21741&action=view)
Minimal test case


-- 


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


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

* [Bug c++/45601] explicit template instanciation problem
  2010-09-08 16:30 [Bug c++/45601] New: explicit template instanciation problem stephane at magnenat dot net
@ 2010-09-08 16:31 ` stephane at magnenat dot net
  2010-09-08 16:31 ` stephane at magnenat dot net
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: stephane at magnenat dot net @ 2010-09-08 16:31 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2980 bytes --]



------- Comment #2 from stephane at magnenat dot net  2010-09-08 16:31 -------
Output of g++ -v -save-temps -o test.o -c test.cpp :

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc
--disable-werror --with-arch-32=i486 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-o' 'test.o' '-c' '-shared-libgcc'
'-mtune=generic'
 /usr/lib/gcc/x86_64-linux-gnu/4.4.3/cc1plus -E -quiet -v -D_GNU_SOURCE
test.cpp -D_FORTIFY_SOURCE=2 -mtune=generic -fpch-preprocess -fstack-protector
-o test.ii
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/c++/4.4
 /usr/include/c++/4.4/x86_64-linux-gnu
 /usr/include/c++/4.4/backward
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.4.3/include
 /usr/lib/gcc/x86_64-linux-gnu/4.4.3/include-fixed
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-o' 'test.o' '-c' '-shared-libgcc'
'-mtune=generic'
 /usr/lib/gcc/x86_64-linux-gnu/4.4.3/cc1plus -fpreprocessed test.ii -quiet
-dumpbase test.cpp -mtune=generic -auxbase-strip test.o -version
-fstack-protector -o test.s
GNU C++ (Ubuntu 4.4.3-4ubuntu5) version 4.4.3 (x86_64-linux-gnu)
        compiled by GNU C version 4.4.3, GMP version 4.3.2, MPFR version
2.4.2-p1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072      
GNU C++ (Ubuntu 4.4.3-4ubuntu5) version 4.4.3 (x86_64-linux-gnu)                
        compiled by GNU C version 4.4.3, GMP version 4.3.2, MPFR version
2.4.2-p1.                                      
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072      
Compiler executable checksum: 88858f45841827736473e527a4e9ab10                  
test.cpp:27: error: template-id ‘h<>’ for ‘void h(T<int>::U)’ does not match
any template declaration 


-- 

stephane at magnenat dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |stephane at magnenat dot net


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


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

* [Bug c++/45601] explicit template instantiation problem
  2010-09-08 16:30 [Bug c++/45601] New: explicit template instanciation problem stephane at magnenat dot net
  2010-09-08 16:31 ` [Bug c++/45601] " stephane at magnenat dot net
  2010-09-08 16:31 ` stephane at magnenat dot net
@ 2010-09-08 16:44 ` paolo dot carlini at oracle dot com
  2010-09-08 16:58 ` paolo dot carlini at oracle dot com
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-09-08 16:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paolo dot carlini at oracle dot com  2010-09-08 16:44 -------
Please clarify: "As far as I can find on the net, it should work." No compiler
to which I have access compiles it, I tried, besides GCC, Intel, SunStudio,
Comeau, VC++8. Note I didn't really analyze the testcase from the Standard
point of view, at the moment I'm just curious to understand how you came to
that conclusion.


-- 


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


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

* [Bug c++/45601] explicit template instantiation problem
  2010-09-08 16:30 [Bug c++/45601] New: explicit template instanciation problem stephane at magnenat dot net
                   ` (2 preceding siblings ...)
  2010-09-08 16:44 ` [Bug c++/45601] explicit template instantiation problem paolo dot carlini at oracle dot com
@ 2010-09-08 16:58 ` paolo dot carlini at oracle dot com
  2010-09-09  7:19 ` stephane at magnenat dot net
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-09-08 16:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from paolo dot carlini at oracle dot com  2010-09-08 16:58 -------
Actually, it seems pretty straightforward to me that S is nondeduced in the
last case: see 14.8.2.4/4, the last line.


-- 

paolo dot carlini at oracle dot com changed:

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


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


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

* [Bug c++/45601] explicit template instantiation problem
  2010-09-08 16:30 [Bug c++/45601] New: explicit template instanciation problem stephane at magnenat dot net
                   ` (3 preceding siblings ...)
  2010-09-08 16:58 ` paolo dot carlini at oracle dot com
@ 2010-09-09  7:19 ` stephane at magnenat dot net
  2010-09-09  7:20 ` stephane at magnenat dot net
  2010-09-09  9:16 ` paolo dot carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: stephane at magnenat dot net @ 2010-09-09  7:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from stephane at magnenat dot net  2010-09-09 07:19 -------
Thank you very much for these explanations, thanks to your pointer I managed to
make a working version, which I will attach to this bug as reference.

As a side-note, it is not easy to access C++ standard because the official ISO
document is non free. While citing the section in the standard, did you refer
to the N3092 draft (as linked from Wikipedia C++ page) or to the official ISO
document? I found a draft of it at
http://www.csci.csusb.edu/dick/c++std/cd2/template.html

If I may suggest, it would be nice that g++ would be a bit more
specific/clearer when reporting the error, because as there are few (if not
none) freely available reference/documentation for complex templates
processing, this would help users very much.


-- 


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


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

* [Bug c++/45601] explicit template instantiation problem
  2010-09-08 16:30 [Bug c++/45601] New: explicit template instanciation problem stephane at magnenat dot net
                   ` (4 preceding siblings ...)
  2010-09-09  7:19 ` stephane at magnenat dot net
@ 2010-09-09  7:20 ` stephane at magnenat dot net
  2010-09-09  9:16 ` paolo dot carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: stephane at magnenat dot net @ 2010-09-09  7:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from stephane at magnenat dot net  2010-09-09 07:20 -------
Created an attachment (id=21747)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21747&action=view)
Working code


-- 


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


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

* [Bug c++/45601] explicit template instantiation problem
  2010-09-08 16:30 [Bug c++/45601] New: explicit template instanciation problem stephane at magnenat dot net
                   ` (5 preceding siblings ...)
  2010-09-09  7:20 ` stephane at magnenat dot net
@ 2010-09-09  9:16 ` paolo dot carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-09-09  9:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from paolo dot carlini at oracle dot com  2010-09-09 09:16 -------
The current ISO document, C++98 or C++03 which contains some rather small
amendments: if C++0x were different it would show only when -std=c++0x is
passed. In any case, it's unfortunate but we cannot do much about the cost of
the document, if you are serious about C++ you should buy it as you buy books
and everything else, is also rather cheap.


-- 


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


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

end of thread, other threads:[~2010-09-09  9:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-08 16:30 [Bug c++/45601] New: explicit template instanciation problem stephane at magnenat dot net
2010-09-08 16:31 ` [Bug c++/45601] " stephane at magnenat dot net
2010-09-08 16:31 ` stephane at magnenat dot net
2010-09-08 16:44 ` [Bug c++/45601] explicit template instantiation problem paolo dot carlini at oracle dot com
2010-09-08 16:58 ` paolo dot carlini at oracle dot com
2010-09-09  7:19 ` stephane at magnenat dot net
2010-09-09  7:20 ` stephane at magnenat dot net
2010-09-09  9:16 ` paolo dot carlini at oracle dot com

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).