public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/40315]  New: template instantiation fails when using const typename
@ 2009-05-31 13:15 doriankrause at web dot de
  2009-08-25 15:39 ` [Bug c++/40315] " bangerth at gmail dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: doriankrause at web dot de @ 2009-05-31 13:15 UTC (permalink / raw)
  To: gcc-bugs

Consider the program:

=========================================

template<int D>
class Foo
{
public:
        typedef double  double3[3];
};

template<int D>
void doSomething(const typename Foo<D>::double3)
{
}

template
void doSomething<2>(const Foo<2>::double3);

template
void doSomething<3>(const Foo<3>::double3);

============================================

On Mac os X 10.5 it fails with gcc-4.4.0 (and also with the default gcc 4.0.1)
with the error message

> /usr/local/gcc-4.4.0/bin/g++ -v test.cc
Using built-in specs.
Target: i686-apple-darwin9
Configured with: ./configure --prefix=/usr/local/gcc-4.4.0 --disable-checking
-enable-werror --enable-languages=c,c++,fortran --build=i686-apple-darwin9
--with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.4.0 (GCC) 
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.5.6' '-v' '-shared-libgcc'
'-mtune=generic'
 /usr/local/gcc-4.4.0/libexec/gcc/i686-apple-darwin9/4.4.0/cc1plus -quiet -v
-D__DYNAMIC__ test.cc -fPIC -quiet -dumpbase test.cc
-mmacosx-version-min=10.5.6 -mtune=generic -auxbase test -version -o
/var/folders/jq/jqHHJIlXEbOleEkgf132gE+++TI/-Tmp-//cctUrpft.s
ignoring nonexistent directory
"/usr/local/gcc-4.4.0/lib/gcc/i686-apple-darwin9/4.4.0/../../../../i686-apple-darwin9/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/gcc-4.4.0/lib/gcc/i686-apple-darwin9/4.4.0/../../../../include/c++/4.4.0

/usr/local/gcc-4.4.0/lib/gcc/i686-apple-darwin9/4.4.0/../../../../include/c++/4.4.0/i686-apple-darwin9

/usr/local/gcc-4.4.0/lib/gcc/i686-apple-darwin9/4.4.0/../../../../include/c++/4.4.0/backward
 /usr/local/include
 /usr/local/gcc-4.4.0/include
 /usr/local/gcc-4.4.0/lib/gcc/i686-apple-darwin9/4.4.0/include
 /usr/local/gcc-4.4.0/lib/gcc/i686-apple-darwin9/4.4.0/include-fixed
 /usr/include
 /System/Library/Frameworks
 /Library/Frameworks
End of search list.
GNU C++ (GCC) version 4.4.0 (i686-apple-darwin9)
        compiled by GNU C version 4.4.0, GMP version 4.2.1, MPFR version 2.3.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 4703a3934dc941165107f7c66932f1e1
test.cc:15: error: template-id 'doSomething<2>' for 'void doSomething(const
double*)' does not match any template declaration
test.cc:18: error: template-id 'doSomething<3>' for 'void doSomething(const
double*)' does not match any template declaration


Removing the const clarifier gives no errors.


-- 
           Summary: template instantiation fails when using const typename
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: doriankrause at web dot de


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


^ permalink raw reply	[flat|nested] 15+ messages in thread
[parent not found: <bug-40315-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2011-05-04 18:31 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-31 13:15 [Bug c++/40315] New: template instantiation fails when using const typename doriankrause at web dot de
2009-08-25 15:39 ` [Bug c++/40315] " bangerth at gmail dot com
2009-08-26 14:43 ` redi at gcc dot gnu dot org
2009-08-26 14:52 ` redi at gcc dot gnu dot org
2009-08-26 19:26 ` doriankrause at web dot de
2009-11-08  4:33 ` jason at gcc dot gnu dot org
2009-11-08  4:37 ` jason at gcc dot gnu dot org
2009-11-08 23:06 ` jason at gcc dot gnu dot org
2009-11-08 23:32 ` jason at gcc dot gnu dot org
2009-11-08 23:41 ` paolo dot carlini at oracle dot com
2010-02-19 21:22 ` jason at gcc dot gnu dot org
2010-02-19 21:45 ` jason at gcc dot gnu dot org
2010-02-19 21:46 ` jason at gcc dot gnu dot org
     [not found] <bug-40315-4@http.gcc.gnu.org/bugzilla/>
2011-05-04 17:42 ` redi at gcc dot gnu.org
2011-05-04 18:31 ` jason at gcc dot gnu.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).