public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
@ 2021-06-11 12:04 jim.w.walker at gmail dot com
  2021-06-11 12:05 ` [Bug c++/101029] " jim.w.walker at gmail dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: jim.w.walker at gmail dot com @ 2021-06-11 12:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101029
           Summary: unexpected error: non-constant condition for static
                    assertion in gcc 10/11, but not 9 (clang also fine)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jim.w.walker at gmail dot com
  Target Milestone: ---

Created attachment 50984
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50984&action=edit
Output from -save-temps

A recent change to use unity builds in a product
(https://github.com/couchbase/kv_engine) I work on produced a build failure
which only occurred on our gcc 10.2 builder, it was fine on clang based builds. 

Further debugging of the issue revealed it appears to build fine on gcc 9. This
investigation also revealed I could make an unrelated code change preceding the
use of a templated type, and the code would then compile (details of this are
below). So far my conclusion is that this is an issue in gcc.

When compiled on gcc 10.2 the following error is seen.

/opt/gcc-10.2.0/include/c++/10.2.0/type_traits: In instantiation of ‘struct
std::is_default_constructible<const char>’:
/opt/gcc-10.2.0/include/c++/10.2.0/type_traits:143:12:   required from ‘struct
std::__and_<std::is_default_constructible<const char>,
std::is_default_constructible<char>,
std::__not_<std::__and_<std::__is_implicitly_default_constructible<const char>,
std::__is_implicitly_default_constructible<char> > > >’
/opt/gcc-10.2.0/include/c++/10.2.0/bits/stl_pair.h:244:59:   required by
substitution of ‘template<class _U1, class _U2, typename
std::enable_if<std::__and_<std::is_default_constructible<_U1>,
std::is_default_constructible<_U2>,
std::__not_<std::__and_<std::__is_implicitly_default_constructible<_U1>,
std::__is_implicitly_default_constructible<_U2> > > >::value, bool>::type
<anonymous> > constexpr std::pair<const char, char>::pair() [with _U1 = const
char; _U2 = char; typename
std::enable_if<std::__and_<std::is_default_constructible<_U1>,
std::is_default_constructible<_U2>,
std::__not_<std::__and_<std::__is_implicitly_default_constructible<_U1>,
std::__is_implicitly_default_constructible<_U2> > > >::value, bool>::type
<anonymous> = <missing>]’
tlm/deps/folly.exploded/include/folly/AtomicHashArray-inl.h:63:19:   required
from here
/opt/gcc-10.2.0/include/c++/10.2.0/type_traits:918:52: error: non-constant
condition for static assertion
  918 |      
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
      |                    
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

The complete gcc command used (this generated the attached file):

/opt/gcc-10.2.0/bin/g++
-DDESTINATION_ROOT=\"/mnt/Code/couchbase/docker/install\" -DEP_USE_ROCKSDB=1
-DFMT_LOCALE -DGLOG_NO_ABBREVIATED_SEVERITIES -DGOOGLE_GLOG_DLL_DECL=""
-DHAVE_BREAKPAD -DHAVE_JEMALLOC -DHAVE_JEMALLOC_SDALLOCX
-DLIBCOUCHSTORE_NO_VISIBILITY
-DMEMCACHED_VERSION=\"5c9636b6d00bf1f53f1302b7d76eee3ba9c0cd0d\"
-DOBJECT_ROOT=\"/home/couchbase/couchbase/kv_engine\"
-DPRODUCT_VERSION=\"0.0.0-0000\"
-DSOURCE_ROOT=\"/mnt/Code/couchbase/docker/kv_engine\" -DSPDLOG_COMPILED_LIB
-DSPDLOG_FMT_EXTERNAL -DSPDLOG_LEVEL_NAMES="{\"TRACE\", \"DEBUG\", \"INFO\",
\"WARNING\", \"ERROR\", \"CRITICAL\", \"OFF\"}" -D_FILE_OFFSET_BITS=64
-D_GNU_SOURCE=1 -D_POSIX_PTHREAD_SEMANTICS -D__EXTENSIONS__=1
-D__STDC_FORMAT_MACROS -Dgsl_CONFIG_CONTRACT_VIOLATION_THROWS
-Itlm/deps/prometheus-cpp.exploded/include -Ikv_engine/engines/ep
-Icouchstore/include -I/mnt/Code/couchbase/docker/couchstore/include
-I/mnt/Code/couchbase/docker/kv_engine/include
-I/mnt/Code/couchbase/docker/kv_engine/tracing
-I/mnt/Code/couchbase/docker/kv_engine/utilities
-I/mnt/Code/couchbase/docker/kv_engine
-I/mnt/Code/couchbase/docker/platform/external
-I/mnt/Code/couchbase/docker/platform/include
-Itlm/deps/flatbuffers.exploded/include -Itlm/deps/snappy.exploded/include
-Ikv_engine/engines/ep/src
-I/mnt/Code/couchbase/docker/kv_engine/engines/ep/src
-I/mnt/Code/couchbase/docker/kv_engine/engines/ep
-I/mnt/Code/couchbase/docker/install/include -Ikv_engine/include
-Iplatform/include
-I/mnt/Code/couchbase/docker/kv_engine/engines/ep/tools/couchfile_upgrade
-I/mnt/Code/couchbase/docker/third_party/spdlog/include -isystem
/mnt/Code/couchbase/docker/third_party/HdrHistogram_c/src -isystem
/mnt/Code/couchbase/docker/phosphor/include -isystem
tlm/deps/boost.exploded/include -isystem tlm/deps/json.exploded/include
-isystem /mnt/Code/couchbase/docker/third_party/gsl-lite/include -isystem
tlm/deps/libevent.exploded/include -isystem tlm/deps/openssl.exploded/include
-isystem tlm/deps/jemalloc.exploded/include -isystem
tlm/deps/rocksdb.exploded/include -isystem
/mnt/Code/couchbase/docker/third_party/googletest/googletest/include -isystem
/mnt/Code/couchbase/docker/third_party/googletest/googlemock/include -isystem
tlm/deps/folly.exploded/include -isystem
tlm/deps/double-conversion.exploded/include -isystem
tlm/deps/glog.exploded/include -isystem tlm/deps/fmt.exploded/include -isystem
tlm/deps/zlib.exploded/include -isystem
/home/couchbase/couchbase/tlm/deps/breakpad.exploded/include/breakpad
-fvisibility=hidden -pthread -pedantic -Wall -Wredundant-decls
-Werror=missing-braces -fno-strict-aliasing -Werror=switch -g -fPIC
-ftls-model=initial-exec -std=c++17 -MD -MT
kv_engine/engines/ep/CMakeFiles/ep_objs.dir/Unity/unity_3_cxx.cxx.o -MF
kv_engine/engines/ep/CMakeFiles/ep_objs.dir/Unity/unity_3_cxx.cxx.o.d -o
kv_engine/engines/ep/CMakeFiles/ep_objs.dir/Unity/unity_3_cxx.cxx.o -c
/mnt/Code/couchbase/docker/kv_engine/engines/ep/src/dcp/producer.cc -save-temps

Please find attached the -save-temps output from a failing build. The cc source
as input here is as small as I could get and keep the error reproduced. It is
completely non-functional but still quite large as a number of library
depdendencies (all open source) get embedded into the output.

As for "unrelated code change allows the code to build":

In the orginal c++ source file, we have a function call for some logging. The
call looks like logger->warn("{}", vbucket). It is the type of the parameter
that can influence if the build errors or succeeds.

In the attached file, this can be seen at line 110615, when I changed that call
to log the uint32_t parameter, the code builds, e.g.

- logger->warn("{}", vbucket);
+ logger->warn("{}", opaque);

This function and the 'vbucket' type are, I'm sure, unrelated from the
templated type on 110619 which is the source of the compiler error.

Note on comparing gcc 9/10/11:

The easiest path for me to test against 9/10/11 in this instance was to compile
using -E, take that output and strip away various external dependencies
(/usr/include and the stdlib etc..) and then use that code in godbolt to try
different gcc compiler. Using this technique I could get object code from gcc
9, but the same error on 10.2, 10.3 and 11.1

This code was used in that test
https://gist.github.com/jimwwalker/d62677965feb347f50c4c11bddc7ab6f

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

* [Bug c++/101029] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
@ 2021-06-11 12:05 ` jim.w.walker at gmail dot com
  2021-06-11 12:17 ` marxin at gcc dot gnu.org
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jim.w.walker at gmail dot com @ 2021-06-11 12:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jim Walker <jim.w.walker at gmail dot com> ---
Adding version output:

/opt/gcc-10.2.0/bin/g++ --version
g++ (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks

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

* [Bug c++/101029] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
  2021-06-11 12:05 ` [Bug c++/101029] " jim.w.walker at gmail dot com
@ 2021-06-11 12:17 ` marxin at gcc dot gnu.org
  2021-06-11 12:22 ` redi at gcc dot gnu.org
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-11 12:17 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
                 CC|                            |marxin at gcc dot gnu.org
   Last reconfirmed|                            |2021-06-11

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, reducing that right now..

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

* [Bug c++/101029] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
  2021-06-11 12:05 ` [Bug c++/101029] " jim.w.walker at gmail dot com
  2021-06-11 12:17 ` marxin at gcc dot gnu.org
@ 2021-06-11 12:22 ` redi at gcc dot gnu.org
  2021-06-11 13:41 ` marxin at gcc dot gnu.org
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2021-06-11 12:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jim Walker from comment #0)
> /opt/gcc-10.2.0/include/c++/10.2.0/type_traits:918:52: error: non-constant
> condition for static assertion
>   918 |      
> static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),

This assertion was added for gcc 10, which is why you don't see it with gcc 9.

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

* [Bug c++/101029] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (2 preceding siblings ...)
  2021-06-11 12:22 ` redi at gcc dot gnu.org
@ 2021-06-11 13:41 ` marxin at gcc dot gnu.org
  2021-06-11 13:42 ` marxin at gcc dot gnu.org
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-11 13:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Created attachment 50985
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50985&action=edit
test-case

I see the following issue when not using an optimization level:

$ g++ gcc_issue.cc -c
gcc_issue.cc: In instantiation of ‘struct is_default_constructible<int>’:
gcc_issue.cc:10:8:   required from ‘struct
__and_<is_default_constructible<int>, int, int>’
gcc_issue.cc:29:57:   required by substitution of ‘template<class _U1, class
_U2, typename enable_if<__and_<is_default_constructible<_U1>, _U2,
int>::valuebool>::type <anonymous> > pair::pair() [with _U1 = int; _U2 = int;
typename enable_if<__and_<is_default_constructible<_U1>, _U2,
int>::valuebool>::type <anonymous> = <missing>]’
:126:31:   required from here
gcc_issue.cc:18:43: error: non-constant condition for static assertion
   18 |   static_assert(__is_complete_or_unbounded(_Tp{}));
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
gcc_issue.cc:18:43:   in ‘constexpr’ expansion of
‘__is_complete_or_unbounded<int>(0).integral_constant<1>::operator
integral_constant<1>::value_type()’
gcc_issue.cc:18:43: internal compiler error: in cxx_eval_call_expression, at
cp/constexpr.c:2701
0x65e879 cxx_eval_call_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.c:2701
0x9a0489 cxx_eval_constant_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.c:6232
0x9acc6d cxx_eval_binary_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.c:3187
0x99f86a cxx_eval_constant_expression
        /home/marxin/Programming/gcc/gcc/cp/constexpr.c:6590
0x9a3f47 cxx_eval_outermost_constant_expr
        /home/marxin/Programming/gcc/gcc/cp/constexpr.c:7264
0xb955e9 finish_static_assert(tree_node*, tree_node*, unsigned int, bool, bool)
        /home/marxin/Programming/gcc/gcc/cp/semantics.c:10306
0xb55ec3 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:18644
0xb55ec3 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:18096
0xb710e9 instantiate_class_template_1
        /home/marxin/Programming/gcc/gcc/cp/pt.c:12009
0xb710e9 instantiate_class_template(tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:12268
0xbbfe17 complete_type(tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/typeck.c:143
0xbbfe17 complete_type(tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/typeck.c:111
0xb7d116 lookup_member(tree_node*, tree_node*, int, bool, int,
access_failure_info*)
        /home/marxin/Programming/gcc/gcc/cp/search.c:1148
0xabbe97 lookup_qualified_name(tree_node*, tree_node*, LOOK_want, bool)
        /home/marxin/Programming/gcc/gcc/cp/name-lookup.c:7113
0xb366f9 tsubst_qualified_id
        /home/marxin/Programming/gcc/gcc/cp/pt.c:16364
0xb3889b tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:19839
0xb54186 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:19082
0xb54186 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:18096
0xb5bf55 tsubst_template_arg(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:12286
0xb5bf55 tsubst_template_arg(tree_node*, tree_node*, int, tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/pt.c:12274
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


while -O is fine:

$ g++ gcc_issue.cc -c -O

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

* [Bug c++/101029] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (3 preceding siblings ...)
  2021-06-11 13:41 ` marxin at gcc dot gnu.org
@ 2021-06-11 13:42 ` marxin at gcc dot gnu.org
  2021-06-11 20:45 ` jason at gcc dot gnu.org
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-11 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
@Jason: Can you please take a look?

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

* [Bug c++/101029] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (4 preceding siblings ...)
  2021-06-11 13:42 ` marxin at gcc dot gnu.org
@ 2021-06-11 20:45 ` jason at gcc dot gnu.org
  2021-06-11 22:20 ` [Bug c++/101029] [10/11/12 regression] " jason at gcc dot gnu.org
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2021-06-11 20:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/101029] [10/11/12 regression] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (5 preceding siblings ...)
  2021-06-11 20:45 ` jason at gcc dot gnu.org
@ 2021-06-11 22:20 ` jason at gcc dot gnu.org
  2021-06-12 16:40 ` cvs-commit at gcc dot gnu.org
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2021-06-11 22:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
            Summary|unexpected error:           |[10/11/12 regression]
                   |non-constant condition for  |unexpected error:
                   |static assertion in gcc     |non-constant condition for
                   |10/11, but not 9 (clang     |static assertion in gcc
                   |also fine)                  |10/11, but not 9 (clang
                   |                            |also fine)

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

* [Bug c++/101029] [10/11/12 regression] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (6 preceding siblings ...)
  2021-06-11 22:20 ` [Bug c++/101029] [10/11/12 regression] " jason at gcc dot gnu.org
@ 2021-06-12 16:40 ` cvs-commit at gcc dot gnu.org
  2021-06-16  9:03 ` jim.w.walker at gmail dot com
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-12 16:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:08e1ff9d6e5a419d5b4a60c077df549e81601d9b

commit r12-1404-g08e1ff9d6e5a419d5b4a60c077df549e81601d9b
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Jun 11 16:55:30 2021 -0400

    c++: constexpr and array[0] [PR101029]

    build_vec_init_elt exits early if we're initializing a zero-element array,
    so build_vec_init needs to do the same to avoid trying to instantiate
things
    after we've already started throwing important bits away.

            PR c++/101029

    gcc/cp/ChangeLog:

            * init.c (build_vec_init): Shortcut [0] case.

    gcc/testsuite/ChangeLog:

            * g++.dg/ext/array4.C: New test.

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

* [Bug c++/101029] [10/11/12 regression] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (7 preceding siblings ...)
  2021-06-12 16:40 ` cvs-commit at gcc dot gnu.org
@ 2021-06-16  9:03 ` jim.w.walker at gmail dot com
  2021-06-16  9:16 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: jim.w.walker at gmail dot com @ 2021-06-16  9:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jim Walker <jim.w.walker at gmail dot com> ---
Thanks for the fast work on this issue. How does it work for gcc bugs in terms
of getting into a release? Would there be a 10.x release that includes this?

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

* [Bug c++/101029] [10/11/12 regression] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (8 preceding siblings ...)
  2021-06-16  9:03 ` jim.w.walker at gmail dot com
@ 2021-06-16  9:16 ` redi at gcc dot gnu.org
  2021-06-16 18:33 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2021-06-16  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It's only fixed on trunk so far, which will become the 12.1 release in 10-11
months.

It's a regression, so either the compiler fix should get backported to the
release branches (including the gcc-10 branch) or the static_assert in the
standard library header should get removed.

https://gcc.gnu.org/develop.html

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

* [Bug c++/101029] [10/11/12 regression] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (9 preceding siblings ...)
  2021-06-16  9:16 ` redi at gcc dot gnu.org
@ 2021-06-16 18:33 ` cvs-commit at gcc dot gnu.org
  2021-06-17  3:38 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-16 18:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:d92613ec5529cecd66ef0c21b894c7f70ace7f87

commit r11-8582-gd92613ec5529cecd66ef0c21b894c7f70ace7f87
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Jun 11 16:55:30 2021 -0400

    c++: constexpr and array[0] [PR101029]

    build_vec_init_elt exits early if we're initializing a zero-element array,
    so build_vec_init needs to do the same to avoid trying to instantiate
things
    after we've already started throwing important bits away.

            PR c++/101029

    gcc/cp/ChangeLog:

            * init.c (build_vec_init): Shortcut [0] case.

    gcc/testsuite/ChangeLog:

            * g++.dg/ext/array4.C: New test.

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

* [Bug c++/101029] [10/11/12 regression] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (10 preceding siblings ...)
  2021-06-16 18:33 ` cvs-commit at gcc dot gnu.org
@ 2021-06-17  3:38 ` cvs-commit at gcc dot gnu.org
  2021-06-17  3:39 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-17  3:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:ff4deb4b1d0c5947669ddc76fde4db83e28009d8

commit r12-1548-gff4deb4b1d0c5947669ddc76fde4db83e28009d8
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jun 16 17:42:15 2021 -0400

    c++: Tweak PR101029 fix

    The case of an initializer with side effects for a zero-length array seems
    extremely unlikely, but we should still return the right type in that case.

            PR c++/101029

    gcc/cp/ChangeLog:

            * init.c (build_vec_init): Preserve the type of base.

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

* [Bug c++/101029] [10/11/12 regression] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (11 preceding siblings ...)
  2021-06-17  3:38 ` cvs-commit at gcc dot gnu.org
@ 2021-06-17  3:39 ` cvs-commit at gcc dot gnu.org
  2021-06-17  3:39 ` cvs-commit at gcc dot gnu.org
  2021-07-06  6:49 ` rguenth at gcc dot gnu.org
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-17  3:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:da25516718cb150cc938f5947650c9ab486505c6

commit r11-8586-gda25516718cb150cc938f5947650c9ab486505c6
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jun 16 17:42:15 2021 -0400

    c++: Tweak PR101029 fix

    The case of an initializer with side effects for a zero-length array seems
    extremely unlikely, but we should still return the right type in that case.

                PR c++/101029

    gcc/cp/ChangeLog:

            * init.c (build_vec_init): Preserve the type of base.

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

* [Bug c++/101029] [10/11/12 regression] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (12 preceding siblings ...)
  2021-06-17  3:39 ` cvs-commit at gcc dot gnu.org
@ 2021-06-17  3:39 ` cvs-commit at gcc dot gnu.org
  2021-07-06  6:49 ` rguenth at gcc dot gnu.org
  14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-06-17  3:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:4b98b55e0e8b4051f4e3b0afc76b506b01f0889f

commit r10-9926-g4b98b55e0e8b4051f4e3b0afc76b506b01f0889f
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Jun 11 16:55:30 2021 -0400

    c++: constexpr and array[0] [PR101029]

    build_vec_init_elt exits early if we're initializing a zero-element array,
    so build_vec_init needs to do the same to avoid trying to instantiate
things
    after we've already started throwing important bits away.

            PR c++/101029

    gcc/cp/ChangeLog:

            * init.c (build_vec_init): Shortcut [0] case.

    gcc/testsuite/ChangeLog:

            * g++.dg/ext/array4.C: New test.

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

* [Bug c++/101029] [10/11/12 regression] unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine)
  2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
                   ` (13 preceding siblings ...)
  2021-06-17  3:39 ` cvs-commit at gcc dot gnu.org
@ 2021-07-06  6:49 ` rguenth at gcc dot gnu.org
  14 siblings, 0 replies; 16+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-06  6:49 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.4
         Resolution|---                         |FIXED
      Known to work|                            |10.3.1, 11.1.1, 12.0
      Known to fail|                            |10.3.0, 11.1.0
             Status|ASSIGNED                    |RESOLVED

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed I guess.

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

end of thread, other threads:[~2021-07-06  6:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 12:04 [Bug c++/101029] New: unexpected error: non-constant condition for static assertion in gcc 10/11, but not 9 (clang also fine) jim.w.walker at gmail dot com
2021-06-11 12:05 ` [Bug c++/101029] " jim.w.walker at gmail dot com
2021-06-11 12:17 ` marxin at gcc dot gnu.org
2021-06-11 12:22 ` redi at gcc dot gnu.org
2021-06-11 13:41 ` marxin at gcc dot gnu.org
2021-06-11 13:42 ` marxin at gcc dot gnu.org
2021-06-11 20:45 ` jason at gcc dot gnu.org
2021-06-11 22:20 ` [Bug c++/101029] [10/11/12 regression] " jason at gcc dot gnu.org
2021-06-12 16:40 ` cvs-commit at gcc dot gnu.org
2021-06-16  9:03 ` jim.w.walker at gmail dot com
2021-06-16  9:16 ` redi at gcc dot gnu.org
2021-06-16 18:33 ` cvs-commit at gcc dot gnu.org
2021-06-17  3:38 ` cvs-commit at gcc dot gnu.org
2021-06-17  3:39 ` cvs-commit at gcc dot gnu.org
2021-06-17  3:39 ` cvs-commit at gcc dot gnu.org
2021-07-06  6:49 ` rguenth 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).