llvm / llvm/llvm-project

[clang] SIGSEGV when evaluating __is_literal for a union with a declarator and a member

Open
#210,572 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clang:frontend crash-on-invalid generated by fuzzer regression:20
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Reproducer:
https://godbolt.org/z/9eGYcc6qx

struct S {
  ~S() {}
};

union U {
  S s;
  U :;
};

static_assert(__is_literal(U), "");

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the C++ reproducer from the issue, using the linked Compiler Explorer example to confirm the SIGSEGV while evaluating __is_literal for the union. Trace Clang's handling of the union declaration and builtin evaluation, then add a regression test using this reproducer and verify that compilation no longer crashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.