public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57775] New: default argument for template parameter error for friend definition in template
@ 2013-07-02  7:51 cooloud at gmail dot com
  2013-07-03 12:33 ` [Bug c++/57775] " daniel.kruegler at googlemail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: cooloud at gmail dot com @ 2013-07-02  7:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 57775
           Summary: default argument for template parameter error for
                    friend definition in template
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cooloud at gmail dot com

MinGW4.7.2 cannot not parse a very simple code like following,

source code:
template <class T=void> struct X
{
    friend void f(){
        struct Y{}; // line 6
    }
};


command and result:
C:\Users\HJ>g++ -v -Wall -Wextra -c tmp.cpp
Using built-in specs.
COLLECT_GCC=g++
Target: mingw32
Configured with: ../gcc-4.7.2/configure
--enable-languages=c,c++,ada,fortran,obj
c,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared
--enable-libgo
mp --disable-win32-registry --enable-libstdcxx-debug
--disable-build-poststage1-
with-cxx --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.7.2 (GCC)
COLLECT_GCC_OPTIONS='-v' '-Wall' '-Wextra' '-c' '-shared-libgcc' '-mtune=i386'
'
-march=i386'
 c:/mingw/bin/../libexec/gcc/mingw32/4.7.2/cc1plus.exe -quiet -v -iprefix
c:\min
gw\bin\../lib/gcc/mingw32/4.7.2/ tmp.cpp -quiet -dumpbase tmp.cpp -mtune=i386
-m
arch=i386 -auxbase tmp -Wall -Wextra -version -o
C:\Users\HJ\AppData\Local\Temp\
cc3msAXa.s
GNU C++ (GCC) version 4.7.2 (mingw32)
        compiled by GNU C version 4.7.2, GMP version 5.0.1, MPFR version 2.4.1,
MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../.
./mingw32/include"
ignoring duplicate directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.2/inclu
de/c++"
ignoring duplicate directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.2/inclu
de/c++/mingw32"
ignoring duplicate directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.2/inclu
de/c++/backward"
ignoring duplicate directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.2/inclu
de"
ignoring duplicate directory "/mingw/lib/gcc/mingw32/4.7.2/../../../../include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../include"
ignoring duplicate directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.2/inclu
de-fixed"
ignoring nonexistent directory
"c:/mingw/lib/gcc/../../lib/gcc/mingw32/4.7.2/../
../../../mingw32/include"
ignoring duplicate directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
 c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++
 c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/mingw32
 c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include/c++/backward
 c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include
 c:\mingw\bin\../lib/gcc/mingw32/4.7.2/../../../../include
 c:\mingw\bin\../lib/gcc/mingw32/4.7.2/include-fixed
End of search list.
GNU C++ (GCC) version 4.7.2 (mingw32)
        compiled by GNU C version 4.7.2, GMP version 5.0.1, MPFR version 2.4.1,
MPC version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: fdc0bc7c97f61ac24bf8edb5646b3bc3
tmp.cpp: In function 'void f()':
tmp.cpp:6:11: error: default argument for template parameter for class
enclosing
 'f()::Y::Y'


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

* [Bug c++/57775] default argument for template parameter error for friend definition in template
  2013-07-02  7:51 [Bug c++/57775] New: default argument for template parameter error for friend definition in template cooloud at gmail dot com
@ 2013-07-03 12:33 ` daniel.kruegler at googlemail dot com
  2015-02-10 17:37 ` jason at gcc dot gnu.org
  2021-08-05  7:00 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-07-03 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The problem still exists for gcc 4.9.0 20130616 (experimental). It sounds a bit
familiar to me, though.
>From gcc-bugs-return-425652-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jul 03 12:55:51 2013
Return-Path: <gcc-bugs-return-425652-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10370 invoked by alias); 3 Jul 2013 12:55:51 -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 10328 invoked by uid 48); 3 Jul 2013 12:55:45 -0000
From: "stephan.kramer at imperial dot ac.uk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57798] New: Incorrect handling of sum over first dimension of a product of automatic arrays
Date: Wed, 03 Jul 2013 12:55:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: stephan.kramer at imperial dot ac.uk
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-57798-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: 2013-07/txt/msg00159.txt.bz2
Content-length: 1356

http://gcc.gnu.org/bugzilla/show_bug.cgi?idW798

            Bug ID: 57798
           Summary: Incorrect handling of sum over first dimension of a
                    product of automatic arrays
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stephan.kramer at imperial dot ac.uk

The test code below results in a segfault evaluating the sum() in the print
statement. This is compiling with gfortran 4.8.1 (4.8.1-4ubuntu1 on Ubuntu
Saucy) without any flags. If bounds checking is switched on (-fbounds-check) I
get a bounds violation error with a random number reported for one of the
bounds:

Fortran runtime error: Dimension 1 of array 'func' has extent 2 instead of
4196256

Is this possibly related to the optimisation requested in
http://gcc.gnu.org/bugzilla/show_bug.cgi?id6841 ?




program test
  implicit none

  call sub(2, 11)

  contains

    function func(m, n)
      integer, intent(in):: m,n
      real, dimension(m, n):: func

      func = 0.0

    end function func

    subroutine sub(m, n)
      integer, intent(in):: m, n
      real, dimension(m,n):: y

      y = 0.0
      print *, sum(y*func(m,n), dim=1)

    end subroutine sub

end program test


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

* [Bug c++/57775] default argument for template parameter error for friend definition in template
  2013-07-02  7:51 [Bug c++/57775] New: default argument for template parameter error for friend definition in template cooloud at gmail dot com
  2013-07-03 12:33 ` [Bug c++/57775] " daniel.kruegler at googlemail dot com
@ 2015-02-10 17:37 ` jason at gcc dot gnu.org
  2021-08-05  7:00 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2015-02-10 17:37 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-02-10
                 CC|                            |jason at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Also happens with trunk on GNU/Linux.  Related to bug 60605.


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

* [Bug c++/57775] default argument for template parameter error for friend definition in template
  2013-07-02  7:51 [Bug c++/57775] New: default argument for template parameter error for friend definition in template cooloud at gmail dot com
  2013-07-03 12:33 ` [Bug c++/57775] " daniel.kruegler at googlemail dot com
  2015-02-10 17:37 ` jason at gcc dot gnu.org
@ 2021-08-05  7:00 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-05  7:00 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
   Target Milestone|---                         |6.0
             Status|NEW                         |RESOLVED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed in GCC 6+.

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

end of thread, other threads:[~2021-08-05  7:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-02  7:51 [Bug c++/57775] New: default argument for template parameter error for friend definition in template cooloud at gmail dot com
2013-07-03 12:33 ` [Bug c++/57775] " daniel.kruegler at googlemail dot com
2015-02-10 17:37 ` jason at gcc dot gnu.org
2021-08-05  7:00 ` pinskia 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).