public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67898] New: rejects-valid on overloaded function as non-type template argument of dependent type
@ 2015-10-08 20:10 richard-gccbugzilla at metafoo dot co.uk
  2021-08-12  1:46 ` [Bug c++/67898] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2015-10-08 20:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67898
           Summary: rejects-valid on overloaded function as non-type
                    template argument of dependent type
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard-gccbugzilla at metafoo dot co.uk
  Target Milestone: ---

Test case:

  void f(int);
  void f(float);
  template<typename T, T F, T G, bool b = F == G> struct X {};
  template<typename T> void test() { X<void(T), f, f>(); }
  int main() { test<int>(); }

GCC rejects this valid code saying:

  <stdin>:4:51: error: ‘void(T)’ is not a valid type for a template non-type
parameter
  <stdin>:4:51: error: ‘void(T)’ is not a valid type for a template non-type
parameter
  <stdin>:4:51: error: template argument 4 is invalid

If we work around this bug by changing the code as follows:

  template<typename T> void test() { X<void(*)(T), f, f>(); }

... then we get a different rejects-valid:

  <stdin>:3:43: error: invalid operands of types ‘<unresolved overloaded
function type>’ and ‘<unresolved overloaded function type>’ to binary
‘operator==’
  <stdin>:4:54: error: template argument 4 is invalid
>From gcc-bugs-return-499051-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Oct 08 20:19:38 2015
Return-Path: <gcc-bugs-return-499051-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5957 invoked by alias); 8 Oct 2015 20:19:37 -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 5898 invoked by uid 48); 8 Oct 2015 20:19:33 -0000
From: "aaro.koskinen at iki dot fi" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/67899] New: build failure in the sanitizer libs on sparc-linux-gnu
Date: Thu, 08 Oct 2015 20:19:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: sanitizer
X-Bugzilla-Version: 5.2.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: aaro.koskinen at iki dot fi
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
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 cc target_milestone
Message-ID: <bug-67899-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: 2015-10/txt/msg00606.txt.bz2
Content-length: 5509

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

            Bug ID: 67899
           Summary: build failure in the sanitizer libs on sparc-linux-gnu
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aaro.koskinen at iki dot fi
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Sanitizer lib build is broken on sparc-linux-gnu:

libtool: compile:  /build/los/work/sparc/gcc-full-5.2.0-build/./gcc/xgcc
-shared-libgcc -B/build/los/work/sparc/gcc-full-5.2.0-build/./gcc -nostdinc++
-L/build/los/work/sparc/gcc-full-5.2.0-build/sparc-linux-gnu/libstdc++-v3/src
-L/build/los/work/sparc/gcc-full-5.2.0-build/sparc-linux-gnu/libstdc++-v3/src/.libs
-L/build/los/work/sparc/gcc-full-5.2.0-build/sparc-linux-gnu/libstdc++-v3/libsupc++/.libs
-B/build/los/work/sparc/toolchain/sparc-linux-gnu/bin/
-B/build/los/work/sparc/toolchain/sparc-linux-gnu/lib/ -isystem
/build/los/work/sparc/toolchain/sparc-linux-gnu/include -isystem
/build/los/work/sparc/toolchain/sparc-linux-gnu/sys-include -D_GNU_SOURCE
-D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-DHAVE_RPC_XDR_H=1 -DHAVE_TIRPC_RPC_XDR_H=0 -I.
-I/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common -I.. -I
/build/los/work/shared/gcc-5.2.0/libsanitizer/include -isystem
/build/los/work/shared/gcc-5.2.0/libsanitizer/include/system -Wall -W
-Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC
-fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables
-fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include
-I../../libstdc++-v3/include/sparc-linux-gnu
-I/build/los/work/shared/gcc-5.2.0/libsanitizer/../libstdc++-v3/libsupc++
-std=gnu++11 -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I
/build/los/work/shared/gcc-5.2.0/libsanitizer/../libbacktrace -I
../libbacktrace -I /build/los/work/shared/gcc-5.2.0/libsanitizer/../include
-include
/build/los/work/shared/gcc-5.2.0/libsanitizer/libbacktrace/backtrace-rename.h
-g -O2 -D_GNU_SOURCE -MT sanitizer_platform_limits_posix.lo -MD -MP -MF
.deps/sanitizer_platform_limits_posix.Tpo -c
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
 -fPIC -DPIC -o .libs/sanitizer_platform_limits_posix.o
In file included from
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:180:0:
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:272:72:
error: size of array 'assertion_failed__990' is negative
     typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                                        ^
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:266:30:
note: in expansion of macro 'IMPL_COMPILER_ASSERT'
 #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                              ^
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:990:1:
note: in expansion of macro 'COMPILER_CHECK'
 COMPILER_CHECK(sizeof(__sanitizer_sigaction) == sizeof(struct sigaction));
 ^
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:272:72:
error: size of array 'assertion_failed__994' is negative
     typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                                        ^
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:266:30:
note: in expansion of macro 'IMPL_COMPILER_ASSERT'
 #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                              ^
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1353:3:
note: in expansion of macro 'COMPILER_CHECK'
   COMPILER_CHECK(offsetof(struct __sanitizer_##CLASS, MEMBER) ==          \
   ^
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:994:1:
note: in expansion of macro 'CHECK_STRUCT_SIZE_AND_OFFSET'
 CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_flags);
 ^
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:272:72:
error: size of array 'assertion_failed__996' is negative
     typedef char IMPL_PASTE(assertion_failed_##_, line)[2*(int)(pred)-1]
                                                                        ^
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:266:30:
note: in expansion of macro 'IMPL_COMPILER_ASSERT'
 #define COMPILER_CHECK(pred) IMPL_COMPILER_ASSERT(pred, __LINE__)
                              ^
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1353:3:
note: in expansion of macro 'COMPILER_CHECK'
   COMPILER_CHECK(offsetof(struct __sanitizer_##CLASS, MEMBER) ==          \
   ^
/build/los/work/shared/gcc-5.2.0/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:996:1:
note: in expansion of macro 'CHECK_STRUCT_SIZE_AND_OFFSET'
 CHECK_STRUCT_SIZE_AND_OFFSET(sigaction, sa_restorer);
 ^
Makefile:449: recipe for target 'sanitizer_platform_limits_posix.lo' failed


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

end of thread, other threads:[~2024-01-30 17:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-08 20:10 [Bug c++/67898] New: rejects-valid on overloaded function as non-type template argument of dependent type richard-gccbugzilla at metafoo dot co.uk
2021-08-12  1:46 ` [Bug c++/67898] " pinskia at gcc dot gnu.org
2021-10-07 20:41 ` ppalka at gcc dot gnu.org
2021-10-11 20:00 ` ppalka at gcc dot gnu.org
2022-04-06 19:53 ` ppalka at gcc dot gnu.org
2024-01-19 18:35 ` cvs-commit at gcc dot gnu.org
2024-01-19 18:39 ` jason at gcc dot gnu.org
2024-01-19 19:33 ` jason at gcc dot gnu.org
2024-01-30 17:30 ` cvs-commit 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).