Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SegFault with __builtin_bit_cast to templated type and auto return type #42281

Closed
llvmbot opened this issue Aug 8, 2019 · 2 comments
Closed
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 8, 2019

Bugzilla Link 42936
Resolution FIXED
Resolved on Aug 12, 2019 11:31
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @zygoloid
Fixed by commit(s) r368600

Extended Description

template struct S { int x;};
auto f() {
int t = 5;
return __builtin_bit_cast(S, t);
}

Error:

  1. :8:41: current parser token ';'
  2. :6:10: parsing function body 'f'
  3. :6:10: in compound statement ('{}')

#​4 0x0000557591fc2a05 clang::ASTContext::getASTRecordLayout(clang::RecordDecl const*) const (/opt/compiler-explorer/clang-trunk-20190808/bin/clang-10+0x47d8a05)
clang-10: error: unable to execute command: Segmentation fault (core dumped)

https://godbolt.org/z/4sPmp2

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented Aug 8, 2019

Reduced slightly:

template struct S { int x;};
S x = __builtin_bit_cast(S, 0);

Looks like we're missing a RequireCompleteType call?

@llvmbot
Copy link
Collaborator Author

llvmbot commented Aug 12, 2019

Fixed in 368600.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

1 participant