public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59978] New: C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard
@ 2014-01-29  9:42 aemseemann at gmail dot com
  2020-07-14  1:17 ` [Bug c++/59978] " richard-gccbugzilla at metafoo dot co.uk
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: aemseemann at gmail dot com @ 2014-01-29  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59978
           Summary: C++11 Non-Type-Template-Parameter Pack Expansion not
                    working according to standard
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aemseemann at gmail dot com

Created attachment 31976
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31976&action=edit
minimal-example source file from the description

In the code below "Ints..." should expand to "1, 2" and therefore correctly
match the signature for "testFunc", but g++ 4.8.2 complains about
"too few arguments to function ‘void testFunc(int, int)’"

static void testFunc(int i1, int i2) {
    (void)i1;
    (void)i2;
}

template <int... Ints> void wrapper() {
    testFunc(Ints...);
}

int main(int, char *[]) {
    wrapper<1, 2>();    
    return 0;
}

Command line: g++ -std=c++11 -Wall -Wextra non-type-template-parameter-pack.cpp

Tested with g++ 4.8.2 on ArchLinux (i686):
g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/4.8.2/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: /build/gcc/src/gcc-4.8-20131219/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-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.8.2 20131219 (prerelease) (GCC) 

GCC from Git-master from 2014/01/28 produces the same error message.

The code compiles fine on clang (3.3 and 3.4)
>From gcc-bugs-return-441840-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 29 10:01:20 2014
Return-Path: <gcc-bugs-return-441840-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17212 invoked by alias); 29 Jan 2014 10:01:20 -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 17200 invoked by uid 48); 29 Jan 2014 10:01:16 -0000
From: "fukanchik at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/59979] New: mpc configure does not check for non-gnu compiler
Date: Wed, 29 Jan 2014 10:01:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: fukanchik at gmail dot com
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-59979-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-01/txt/msg02982.txt.bz2
Content-length: 3258

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

            Bug ID: 59979
           Summary: mpc configure does not check for non-gnu compiler
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fukanchik at gmail dot com

There is something called gcc in my system, but the real compiler is called
`cc'. GMP and MPFR are compiling fine. Configure scripts are able to detect the
correct compiler. MPC configure script does not look for something else but
gcc:

uname -a:
SunOS host 5.10 Generic_147441-20 i86pc i386 i86pc

Configure output (MPC):

checking host system type... i386-pc-solaris2.10
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: in `/cpp/mpc/mpc-0.8.1':
configure: error: C compiler cannot create executables

This is what happens in GMP (which builds successfully):
checking ABId
checking compiler gcc -O2 -pedantic -m64 ... no
checking compiler cc -xO3 -m64 ... yes
checking for gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes

configure log (MPC):
configure:3085: checking for gcc
configure:3101: found /nfs/system/bin/gcc
configure:3112: result: gcc
configure:3341: checking for C compiler version
configure:3350: gcc --version >&5
./configure: line 3352: /nfs/system/bin/gcc: Invalid argument
configure:3361: $? = 126
configure:3350: gcc -v >&5
./configure: line 3352: /nfs/system/bin/gcc: Invalid argument
configure:3361: $? = 126
configure:3350: gcc -V >&5
./configure: line 3352: /nfs/system/bin/gcc: Invalid argument
configure:3361: $? = 126
configure:3350: gcc -qversion >&5
./configure: line 3352: /nfs/system/bin/gcc: Invalid argument
configure:3361: $? = 126
configure:3383: checking for C compiler default output file name
configure:3405: gcc  -I/apps/grimis/cpp/include -I/apps/grimis/cpp/include
-L/apps/grimis/cpp/lib -L/apps/grimis/cpp/lib  conftest.c  >&5
./configure: line 3407: /nfs/system/bin/gcc: Invalid argument

configure log (GMP):
abilistd 32
cclist=gcc icc cc
configure:4346: gcc 2>&1 | grep xlc >/dev/null
configure:4349: $? = 1
configure:4403: checking compiler gcc -O2 -pedantic -m64
Test compile:
configure:4417: gcc -O2 -pedantic -m64  conftest.c >&5
./configure: line 4418: /nfs/system/bin/gcc: Invalid argument
configure:4420: $? = 126
failed program was:

int main () { return 0; }
configure:5443: result: no
configure:4324: cc -c conftest.c >&5
"conftest.c", line 2: warning: old-style declaration or incorrect type for:
choke
"conftest.c", line 2: syntax error before or at: me
"conftest.c", line 3: warning: old-style declaration or incorrect type for: me
cc: acomp failed for conftest.c
configure:4327: $? = 2
configure:4346: cc 2>&1 | grep xlc >/dev/null
configure:4349: $? = 1
configure:4403: checking compiler cc -xO3 -m64
Test compile:
configure:4417: cc -xO3 -m64  conftest.c >&5
configure:4420: $? = 0
configure:4425: ./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest
configure:4428: $? = 0
...
configure:5443: result: yes
configure:7103: checking for gcc
configure:7130: result: cc


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

* [Bug c++/59978] C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard
  2014-01-29  9:42 [Bug c++/59978] New: C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard aemseemann at gmail dot com
@ 2020-07-14  1:17 ` richard-gccbugzilla at metafoo dot co.uk
  2020-07-14  2:28 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2020-07-14  1:17 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Smith <richard-gccbugzilla at metafoo dot co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |richard-gccbugzilla@metafoo
                   |                            |.co.uk

--- Comment #1 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
This appears to have been fixed in GCC 5.2 onwards.

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

* [Bug c++/59978] C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard
  2014-01-29  9:42 [Bug c++/59978] New: C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard aemseemann at gmail dot com
  2020-07-14  1:17 ` [Bug c++/59978] " richard-gccbugzilla at metafoo dot co.uk
@ 2020-07-14  2:28 ` mpolacek at gcc dot gnu.org
  2020-07-14 21:33 ` cvs-commit at gcc dot gnu.org
  2020-07-14 21:36 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-07-14  2:28 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |mpolacek at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Right, thanks, fixed in r224162.  That came without a test so I'll add this
one.

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

* [Bug c++/59978] C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard
  2014-01-29  9:42 [Bug c++/59978] New: C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard aemseemann at gmail dot com
  2020-07-14  1:17 ` [Bug c++/59978] " richard-gccbugzilla at metafoo dot co.uk
  2020-07-14  2:28 ` mpolacek at gcc dot gnu.org
@ 2020-07-14 21:33 ` cvs-commit at gcc dot gnu.org
  2020-07-14 21:36 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-07-14 21:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:4358099049cbb8180c5354c6754b04ff0b330835

commit r11-2099-g4358099049cbb8180c5354c6754b04ff0b330835
Author: Marek Polacek <polacek@redhat.com>
Date:   Tue Jul 14 17:31:08 2020 -0400

    c++: Add new test [PR59978]

    Fixed in r224162.  That came without a test so adding this one.
    Previously, we issued a bogus "too few arguments to function" error.

    gcc/testsuite/ChangeLog:

            PR c++/59978
            * g++.dg/cpp0x/vt-59978.C: New test.

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

* [Bug c++/59978] C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard
  2014-01-29  9:42 [Bug c++/59978] New: C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard aemseemann at gmail dot com
                   ` (2 preceding siblings ...)
  2020-07-14 21:33 ` cvs-commit at gcc dot gnu.org
@ 2020-07-14 21:36 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-07-14 21:36 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Done.

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

end of thread, other threads:[~2020-07-14 21:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-29  9:42 [Bug c++/59978] New: C++11 Non-Type-Template-Parameter Pack Expansion not working according to standard aemseemann at gmail dot com
2020-07-14  1:17 ` [Bug c++/59978] " richard-gccbugzilla at metafoo dot co.uk
2020-07-14  2:28 ` mpolacek at gcc dot gnu.org
2020-07-14 21:33 ` cvs-commit at gcc dot gnu.org
2020-07-14 21:36 ` mpolacek 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).