public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61642] New: g++ confuses template member template function with template class
@ 2014-06-28 23:08 felix at fontein dot de
  2014-06-29 16:39 ` [Bug c++/61642] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: felix at fontein dot de @ 2014-06-28 23:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61642

            Bug ID: 61642
           Summary: g++ confuses template member template function with
                    template class
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: felix at fontein dot de

The following code does not compile under GCC 4.9.0 20140604 (prerelease):

---------8<---------8<---------8<---------
template<typename T> struct X { };

template<typename Ftype, int x, int y>
void fCall(Ftype & f)
{
    f.template X<x, y>(); // compiler stops here, confuses f's 
                          // member template X with the template
                          // class X defined above  
}

// To be used like this:

struct F
{
    template<int x, int y> void X() { }
};

int main()
{
    F f;
    fCall<F, 1, 2>(f);
}
---------8<---------8<---------8<---------

The error message:

$ g++ -Wall -Wextra t2.cpp -o t2
t2.cpp: In function ‘void fCall(Ftype&)’:
t2.cpp:6:22: error: wrong number of template arguments (2, should be 1)
     f.template X<x, y>();
                      ^
t2.cpp:1:29: error: provided for ‘template<class T> struct X’
 template<typename T> struct X { };


$ g++ -v

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /build/gcc/src/gcc-4.9-20140604/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch
--disable-libssp --enable-gnu-unique-object --enable-linker-build-id
--enable-cloog-backend=isl --disable-isl-version-check
--disable-cloog-version-check --enable-lto --enable-plugin
--enable-install-libiberty --with-linker-hash-style=gnu --disable-multilib
--disable-werror --enable-checking=release
Thread model: posix
gcc version 4.9.0 20140604 (prerelease) (GCC)
>From gcc-bugs-return-455243-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jun 28 23:16:05 2014
Return-Path: <gcc-bugs-return-455243-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 19499 invoked by alias); 28 Jun 2014 23:16:04 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 19361 invoked by uid 48); 28 Jun 2014 23:15:56 -0000
From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/61640] KIND=4 Character Array Internal Unit Read Fail
Date: Sat, 28 Jun 2014 23:16:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libfortran
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jvdelisle at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: jvdelisle at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61640-4-0sIHI6jsE8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61640-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61640-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-06/txt/msg02325.txt.bz2
Content-length: 309

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida640

--- Comment #4 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Full patch submitted to gfortran list. The problem found in this PR was masking
a problem in eat_spaces for KIND=4.  Was missing some parenthesis for the
indexing into the internal unit.


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

* [Bug c++/61642] g++ confuses template member template function with template class
  2014-06-28 23:08 [Bug c++/61642] New: g++ confuses template member template function with template class felix at fontein dot de
@ 2014-06-29 16:39 ` redi at gcc dot gnu.org
  2014-06-29 16:41 ` redi at gcc dot gnu.org
  2015-03-20 17:20 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2014-06-29 16:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61642

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Felix Fontein from comment #0)
> The following code does not compile under GCC 4.9.0 20140604 (prerelease):

I wish Arch wouldn't fsck with the release numbering like this, 4.9.0 was
released well before 20140604, so it's not a 4.9.0 prerelease.


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

* [Bug c++/61642] g++ confuses template member template function with template class
  2014-06-28 23:08 [Bug c++/61642] New: g++ confuses template member template function with template class felix at fontein dot de
  2014-06-29 16:39 ` [Bug c++/61642] " redi at gcc dot gnu.org
@ 2014-06-29 16:41 ` redi at gcc dot gnu.org
  2015-03-20 17:20 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2014-06-29 16:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61642

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-06-29
     Ever confirmed|0                           |1


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

* [Bug c++/61642] g++ confuses template member template function with template class
  2014-06-28 23:08 [Bug c++/61642] New: g++ confuses template member template function with template class felix at fontein dot de
  2014-06-29 16:39 ` [Bug c++/61642] " redi at gcc dot gnu.org
  2014-06-29 16:41 ` redi at gcc dot gnu.org
@ 2015-03-20 17:20 ` paolo.carlini at oracle dot com
  2 siblings, 0 replies; 4+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-20 17:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61642

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lucdanton at free dot fr

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 65497 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2015-03-20 16:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-28 23:08 [Bug c++/61642] New: g++ confuses template member template function with template class felix at fontein dot de
2014-06-29 16:39 ` [Bug c++/61642] " redi at gcc dot gnu.org
2014-06-29 16:41 ` redi at gcc dot gnu.org
2015-03-20 17:20 ` paolo.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).