llvm-project/clang/test/Modules/gmodules-nodebug.cpp
Michael Buch 30e276d06d
[clang][PCH] Don't try to create standalone debug-info for types marked nodebug (#123253)
Fixes one of the crashes uncovered by
https://github.com/llvm/llvm-project/pull/118710

`getOrCreateStandaloneType` asserts that a `DIType` was created for the
requested type. If the `Decl` was marked `nodebug`, however, we can't
generate debug-info for it, so we would previously trigger the assert.
For now keep the assertion around and check the `nodebug` at the
callsite.
2025-01-17 09:35:02 +00:00

15 lines
424 B
C++

// REQUIRES: asserts
// RUN: %clang_cc1 -std=c++23 -x c++-header -emit-pch -fmodule-format=obj \
// RUN: -o %t.pch %s \
// RUN: -mllvm -debug-only=pchcontainer &>%t-pch.ll
// RUN: cat %t-pch.ll | FileCheck %s
template<class...>
using __void_t [[gnu::nodebug]] = void;
__void_t<> func() {}
// CHECK: !DICompileUnit
// CHECK-NOT: __void_t