public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109756] New: "internal compiler error: tree check" when using the [[assume]] attribute with pack expansion
@ 2023-05-06 10:33 ensadc at mailnesia dot com
  2023-05-06 16:40 ` [Bug c++/109756] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ensadc at mailnesia dot com @ 2023-05-06 10:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109756
           Summary: "internal compiler error: tree check" when using the
                    [[assume]] attribute with pack expansion
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ensadc at mailnesia dot com
  Target Milestone: ---

https://godbolt.org/z/WPn9aq8sr

====
bool f(auto... args) {
    [[assume(args > 0)...]];
    return ((args == 0) && ...);
}

bool g(int a, int b) {
    return f(a, b);
}

====
<source>: In function 'bool f(auto:1 ...)':
<source>:2:28: internal compiler error: tree check: expected tree that contains
'common' structure, have 'expr_pack_expansion' in list_length, at tree.cc:3414
    2 |     [[assume(args > 0)...]];
      |                            ^
0x235945e internal_error(char const*, ...)
        ???:0
0x96da3a tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        ???:0
0xb20632 process_stmt_assume_attribute(tree_node*, tree_node*, unsigned int)
        ???:0
0xc7212f c_parse_file()
        ???:0
0xdb0d99 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

====
I believe that [[assume(args > 0)...]] is a valid pack expansion. The standard
says ([temp.variadic]/5):

> Pack expansions can occur in the following contexts:
> (5.8) - In an attribute-list ([dcl.attr.grammar]); the pattern is an attribute.

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

end of thread, other threads:[~2023-05-10  9:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-06 10:33 [Bug c++/109756] New: "internal compiler error: tree check" when using the [[assume]] attribute with pack expansion ensadc at mailnesia dot com
2023-05-06 16:40 ` [Bug c++/109756] " pinskia at gcc dot gnu.org
2023-05-06 16:54 ` jakub at gcc dot gnu.org
2023-05-06 16:59 ` pinskia at gcc dot gnu.org
2023-05-06 17:00 ` pinskia at gcc dot gnu.org
2023-05-07 19:02 ` jakub at gcc dot gnu.org
2023-05-08 10:56 ` jakub at gcc dot gnu.org
2023-05-08 11:26 ` jakub at gcc dot gnu.org
2023-05-09 14:07 ` cvs-commit at gcc dot gnu.org
2023-05-09 14:10 ` cvs-commit at gcc dot gnu.org
2023-05-10  9:41 ` 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).