CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
65 lines
2.6 KiB
C++
65 lines
2.6 KiB
C++
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
|
|
// RUN: %clang_cc1 -fmodules -fmodule-map-file=%t/module.modulemap -emit-module -o %t/A.pcm -fmodule-name=A -x c++ %t/module.modulemap -Wdelete-non-virtual-dtor
|
|
// RUN: %clang_cc1 -fmodules -fmodule-map-file=%t/module.modulemap -fmodule-file=A=%t/A.pcm -I%t %t/use.cc -Wdelete-non-virtual-dtor -verify
|
|
|
|
// RUN: %clang_cc1 -fmodules -fmodule-map-file=%t/module.modulemap -fmodule-file=A=%t/A.pcm -I%t %t/use.cc -Wsystem-headers -Wdelete-non-virtual-dtor -verify=sys
|
|
|
|
//--- module.modulemap
|
|
module A [system] {
|
|
header "A.h"
|
|
}
|
|
|
|
//--- A.h
|
|
template<typename T>
|
|
void make_unique() {
|
|
T();
|
|
}
|
|
|
|
template<typename T>
|
|
void delete_ptr(T *p) {
|
|
delete p;
|
|
}
|
|
|
|
int x;;
|
|
|
|
//--- use.cc
|
|
#include "A.h"
|
|
|
|
// 1. Check that deprecated warnings are emitted even if the template is in a
|
|
// system module, when the instantiation is triggered from user code.
|
|
// This works because SemaAvailability uses AllowWarningInSystemHeaders RAII
|
|
// to temporarily disable suppression.
|
|
// expected-warning@A.h:3 2 {{'C' is deprecated}}
|
|
// sys-warning@A.h:3 2 {{'C' is deprecated}}
|
|
|
|
// 2. Check that warnings with ShowInSystemHeader (like -Wdelete-non-virtual-dtor)
|
|
// are still emitted from system modules.
|
|
// expected-warning@A.h:8 {{delete called on non-final 'Base' that has virtual functions but non-virtual destructor}}
|
|
// sys-warning@A.h:8 {{delete called on non-final 'Base' that has virtual functions but non-virtual destructor}}
|
|
|
|
// 3. Check that unrelated system header warnings (like -Wextra-semi) remain
|
|
// suppressed even with -Wsystem-headers for explicit modules, preserving
|
|
// the hermeticity of the diagnostic state serialized into the PCM.
|
|
// If this were not hermetic, we would see a 'sys-warning' for the extra semi
|
|
// at A.h:11.
|
|
|
|
class C {
|
|
public:
|
|
C() __attribute__((deprecated("",""))); // expected-note 2 {{'C' has been explicitly marked deprecated here}} \
|
|
// sys-note 2 {{'C' has been explicitly marked deprecated here}}
|
|
};
|
|
|
|
struct Base {
|
|
virtual void f();
|
|
};
|
|
struct Derived : Base {};
|
|
|
|
void bar() {
|
|
make_unique<C>(); // expected-note {{in instantiation of function template specialization 'make_unique<C>' requested here}} \
|
|
// sys-note {{in instantiation of function template specialization 'make_unique<C>' requested here}}
|
|
delete_ptr((Base*)new Derived); // expected-note {{in instantiation of function template specialization 'delete_ptr<Base>' requested here}} \
|
|
// sys-note {{in instantiation of function template specialization 'delete_ptr<Base>' requested here}}
|
|
}
|