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
117 lines
5.8 KiB
C++
117 lines
5.8 KiB
C++
// RUN: %clang_cc1 -fsyntax-only -std=c++20 -verify -Wreserved-identifier %s
|
|
|
|
int foo__bar() { return 0; } // expected-warning {{identifier 'foo__bar' is reserved because it contains '__'}}
|
|
static int _bar() { return 0; } // expected-warning {{identifier '_bar' is reserved because it starts with '_' at global scope}}
|
|
static int _Bar() { return 0; } // expected-warning {{identifier '_Bar' is reserved because it starts with '_' followed by a capital letter}}
|
|
int _barbouille() { return 0; } // expected-warning {{identifier '_barbouille' is reserved because it starts with '_' at global scope}}
|
|
|
|
void foo(unsigned int _Reserved) { // expected-warning {{identifier '_Reserved' is reserved because it starts with '_' followed by a capital letter}}
|
|
unsigned int __1 = // expected-warning {{identifier '__1' is reserved because it starts with '__'}}
|
|
_Reserved; // no-warning
|
|
}
|
|
|
|
// This one is explicitly skipped by -Wreserved-identifier
|
|
void *_; // no-warning
|
|
|
|
template <class T> constexpr bool __toucan = true; // expected-warning {{identifier '__toucan' is reserved because it starts with '__'}}
|
|
|
|
template <class T>
|
|
concept _Barbotine = __toucan<T>; // expected-warning {{identifier '_Barbotine' is reserved because it starts with '_' followed by a capital letter}}
|
|
|
|
template <class __> // expected-warning {{'__' is reserved because it starts with '__'}}
|
|
struct BarbeNoire {};
|
|
|
|
template <class _not_reserved> // no-warning
|
|
struct BarbeJaune {};
|
|
|
|
template <class __> // expected-warning {{'__' is reserved because it starts with '__'}}
|
|
void BarbeRousse() {}
|
|
|
|
namespace _Barbidur { // expected-warning {{identifier '_Barbidur' is reserved because it starts with '_' followed by a capital letter}}
|
|
|
|
struct __barbidou {}; // expected-warning {{identifier '__barbidou' is reserved because it starts with '__'}}
|
|
struct _barbidou {}; // no-warning
|
|
|
|
int __barbouille; // expected-warning {{identifier '__barbouille' is reserved because it starts with '__'}}
|
|
int _barbouille; // no-warning
|
|
|
|
int __babar() { return 0; } // expected-warning {{identifier '__babar' is reserved because it starts with '__'}}
|
|
int _babar() { return 0; } // no-warning
|
|
|
|
} // namespace _Barbidur
|
|
|
|
class __barbapapa { // expected-warning {{identifier '__barbapapa' is reserved because it starts with '__'}}
|
|
void _barbabelle() {} // no-warning
|
|
int _Barbalala; // expected-warning {{identifier '_Barbalala' is reserved because it starts with '_' followed by a capital letter}}
|
|
};
|
|
|
|
enum class __menu { // expected-warning {{identifier '__menu' is reserved because it starts with '__'}}
|
|
__some, // expected-warning {{identifier '__some' is reserved because it starts with '__'}}
|
|
_Other, // expected-warning {{identifier '_Other' is reserved because it starts with '_' followed by a capital letter}}
|
|
_other // no-warning
|
|
};
|
|
|
|
enum _Menu { // expected-warning {{identifier '_Menu' is reserved because it starts with '_' followed by a capital letter}}
|
|
_OtheR_, // expected-warning {{identifier '_OtheR_' is reserved because it starts with '_' followed by a capital letter}}
|
|
_other_ // expected-warning {{identifier '_other_' is reserved because it starts with '_' at global scope}}
|
|
};
|
|
|
|
enum {
|
|
__some, // expected-warning {{identifier '__some' is reserved because it starts with '__'}}
|
|
_Other, // expected-warning {{identifier '_Other' is reserved because it starts with '_' followed by a capital letter}}
|
|
_other // expected-warning {{identifier '_other' is reserved because it starts with '_' at global scope}}
|
|
};
|
|
|
|
static union {
|
|
int _barbeFleurie; // no-warning
|
|
};
|
|
|
|
using _Barbamama = __barbapapa; // expected-warning {{identifier '_Barbamama' is reserved because it starts with '_' followed by a capital letter}}
|
|
|
|
int foobar() {
|
|
return foo__bar(); // no-warning
|
|
}
|
|
|
|
namespace {
|
|
int _barbatruc; // no-warning
|
|
}
|
|
|
|
long double operator"" _BarbeBleue(long double) // expected-warning {{identifier '_BarbeBleue' is reserved because it starts with '_' followed by a capital letter}}\
|
|
// expected-warning {{identifier '_BarbeBleue' preceded by whitespace in a literal operator declaration is deprecated}}
|
|
{
|
|
return 0.;
|
|
}
|
|
|
|
long double operator""_SacreBleu(long double) // no-warning
|
|
{
|
|
return 0.;
|
|
}
|
|
|
|
long double sacrebleu = operator"" _SacreBleu(1.2); // expected-warning {{identifier '_SacreBleu' is reserved because it starts with '_' followed by a capital letter}} \
|
|
// expected-warning {{identifier '_SacreBleu' preceded by whitespace in a literal operator declaration is deprecated}}
|
|
long double sangbleu = operator""_SacreBleu(1.2); // no-warning
|
|
|
|
void operator"" _lowercase(unsigned long long); // expected-warning {{identifier '_lowercase' preceded by whitespace in a literal operator declaration is deprecated}}
|
|
void operator""_lowercase(unsigned long long); // no-warning
|
|
|
|
struct _BarbeRouge { // expected-warning {{identifier '_BarbeRouge' is reserved because it starts with '_' followed by a capital letter}}
|
|
} p;
|
|
struct _BarbeNoire { // expected-warning {{identifier '_BarbeNoire' is reserved because it starts with '_' followed by a capital letter}}
|
|
} * q;
|
|
|
|
struct Any {
|
|
friend void _barbegrise(); // expected-warning {{identifier '_barbegrise' is reserved because it starts with '_' at global scope}}
|
|
};
|
|
|
|
#define _not_reserved
|
|
#define _Reserved // expected-warning {{macro name is a reserved identifier}}
|
|
#undef _not_reserved
|
|
#undef _Reserved // expected-warning {{macro name is a reserved identifier}}
|
|
|
|
namespace N {
|
|
int _namespace_a;
|
|
extern "C" int _namespace_b; // expected-warning {{identifier '_namespace_b' is reserved because it starts with '_' and has C language linkage}}
|
|
void _namespace_c();
|
|
extern "C" void _namespace_d(); // expected-warning {{identifier '_namespace_d' is reserved because it starts with '_' and has C language linkage}}
|
|
}
|