mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8086027: Multiple STATIC_ASSERTs at class scope doesn't work
Make supporting typedef name unique via __LINE__ concatenation Reviewed-by: dholmes, brutisso
This commit is contained in:
parent
f286447281
commit
4bbbdd7aa6
3 changed files with 39 additions and 1 deletions
|
@ -770,3 +770,31 @@ extern "C" void pns(void* sp, void* fp, void* pc) { // print native stack
|
|||
}
|
||||
|
||||
#endif // !PRODUCT
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// Test multiple STATIC_ASSERT forms in various scopes.
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
||||
// namespace scope
|
||||
STATIC_ASSERT(true);
|
||||
STATIC_ASSERT(true);
|
||||
STATIC_ASSERT(1 == 1);
|
||||
STATIC_ASSERT(0 == 0);
|
||||
|
||||
void test_multiple_static_assert_forms_in_function_scope() {
|
||||
STATIC_ASSERT(true);
|
||||
STATIC_ASSERT(true);
|
||||
STATIC_ASSERT(0 == 0);
|
||||
STATIC_ASSERT(1 == 1);
|
||||
}
|
||||
|
||||
// class scope
|
||||
struct TestMultipleStaticAssertFormsInClassScope {
|
||||
STATIC_ASSERT(true);
|
||||
STATIC_ASSERT(true);
|
||||
STATIC_ASSERT(0 == 0);
|
||||
STATIC_ASSERT(1 == 1);
|
||||
};
|
||||
|
||||
#endif // !PRODUCT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue