r290159 - Fix the spelling of 'bitfield' in diagnostics to be consistently 'bit-field'.
Chandler Carruth via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 19 18:43:58 PST 2016
Author: chandlerc
Date: Mon Dec 19 20:43:58 2016
New Revision: 290159
URL: http://llvm.org/viewvc/llvm-project?rev=290159&view=rev
Log:
Fix the spelling of 'bitfield' in diagnostics to be consistently 'bit-field'.
The latter agrees with most existing diagnostics and the C and C++ standards.
Differential Revision: https://reviews.llvm.org/D26530
Modified:
cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/test/Parser/objc-property-syntax.m
cfe/trunk/test/Sema/constant-conversion.c
cfe/trunk/test/SemaCXX/conversion.cpp
cfe/trunk/test/SemaCXX/member-init.cpp
cfe/trunk/test/SemaOpenCL/unsupported.cl
Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=290159&r1=290158&r2=290159&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Mon Dec 19 20:43:58 2016
@@ -398,7 +398,7 @@ def err_objc_expected_selector_for_gette
"expected selector for Objective-C %select{setter|getter}0">;
def err_objc_property_requires_field_name : Error<
"property requires fields to be named">;
-def err_objc_property_bitfield : Error<"property name cannot be a bitfield">;
+def err_objc_property_bitfield : Error<"property name cannot be a bit-field">;
def err_objc_expected_property_attr : Error<"unknown property attribute %0">;
def err_objc_properties_require_objc2 : Error<
"properties are an Objective-C 2 feature">;
@@ -726,7 +726,7 @@ def warn_cxx98_compat_nonstatic_member_i
"in-class initialization of non-static data members is incompatible with C++98">,
InGroup<CXX98Compat>, DefaultIgnore;
def err_bitfield_member_init: Error<
- "bitfield member cannot have an in-class initializer">;
+ "bit-field member cannot have an in-class initializer">;
def err_incomplete_array_member_init: Error<
"array bound cannot be deduced from an in-class initializer">;
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=290159&r1=290158&r2=290159&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Dec 19 20:43:58 2016
@@ -2930,7 +2930,7 @@ def warn_impcast_integer_precision_const
"implicit conversion from %2 to %3 changes value from %0 to %1">,
InGroup<ConstantConversion>;
def warn_impcast_bitfield_precision_constant : Warning<
- "implicit truncation from %2 to bitfield changes value from %0 to %1">,
+ "implicit truncation from %2 to bit-field changes value from %0 to %1">,
InGroup<BitFieldConstantConversion>;
def warn_impcast_literal_float_to_integer : Warning<
@@ -8088,7 +8088,7 @@ def err_opencl_function_variable : Error
def err_static_function_scope : Error<
"variables in function scope cannot be declared static">;
def err_opencl_bitfields : Error<
- "bitfields are not supported in OpenCL">;
+ "bit-fields are not supported in OpenCL">;
def err_opencl_vla : Error<
"variable length arrays are not supported in OpenCL">;
def err_bad_kernel_param_type : Error<
Modified: cfe/trunk/test/Parser/objc-property-syntax.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/objc-property-syntax.m?rev=290159&r1=290158&r2=290159&view=diff
==============================================================================
--- cfe/trunk/test/Parser/objc-property-syntax.m (original)
+++ cfe/trunk/test/Parser/objc-property-syntax.m Mon Dec 19 20:43:58 2016
@@ -4,7 +4,7 @@
int prop;
};
@property unsigned char bufferedUTF8Bytes[4]; // expected-error {{property cannot have array or function type}}
- at property unsigned char bufferedUTFBytes:1; // expected-error {{property name cannot be a bitfield}}
+ at property unsigned char bufferedUTFBytes:1; // expected-error {{property name cannot be a bit-field}}
@property(nonatomic, retain, setter=ab_setDefaultToolbarItems) MyClass *ab_defaultToolbarItems; // expected-error {{method name referenced in property setter attribute must end with ':'}}
@property int prop;
Modified: cfe/trunk/test/Sema/constant-conversion.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/constant-conversion.c?rev=290159&r1=290158&r2=290159&view=diff
==============================================================================
--- cfe/trunk/test/Sema/constant-conversion.c (original)
+++ cfe/trunk/test/Sema/constant-conversion.c Mon Dec 19 20:43:58 2016
@@ -11,7 +11,7 @@ void test_6792488(void) {
void test_7809123(void) {
struct { int i5 : 5; } a;
- a.i5 = 36; // expected-warning {{implicit truncation from 'int' to bitfield changes value from 36 to 4}}
+ a.i5 = 36; // expected-warning {{implicit truncation from 'int' to bit-field changes value from 36 to 4}}
}
void test() {
@@ -31,11 +31,11 @@ void test3() {
int bar : 2;
};
- struct A a = { 0, 10 }; // expected-warning {{implicit truncation from 'int' to bitfield changes value from 10 to -2}}
- struct A b[] = { 0, 10, 0, 0 }; // expected-warning {{implicit truncation from 'int' to bitfield changes value from 10 to -2}}
- struct A c[] = {{10, 0}}; // expected-warning {{implicit truncation from 'int' to bitfield changes value from 10 to 2}}
- struct A d = (struct A) { 10, 0 }; // expected-warning {{implicit truncation from 'int' to bitfield changes value from 10 to 2}}
- struct A e = { .foo = 10 }; // expected-warning {{implicit truncation from 'int' to bitfield changes value from 10 to 2}}
+ struct A a = { 0, 10 }; // expected-warning {{implicit truncation from 'int' to bit-field changes value from 10 to -2}}
+ struct A b[] = { 0, 10, 0, 0 }; // expected-warning {{implicit truncation from 'int' to bit-field changes value from 10 to -2}}
+ struct A c[] = {{10, 0}}; // expected-warning {{implicit truncation from 'int' to bit-field changes value from 10 to 2}}
+ struct A d = (struct A) { 10, 0 }; // expected-warning {{implicit truncation from 'int' to bit-field changes value from 10 to 2}}
+ struct A e = { .foo = 10 }; // expected-warning {{implicit truncation from 'int' to bit-field changes value from 10 to 2}}
}
void test4() {
@@ -43,7 +43,7 @@ void test4() {
char c : 2;
} a;
- a.c = 0x101; // expected-warning {{implicit truncation from 'int' to bitfield changes value from 257 to 1}}
+ a.c = 0x101; // expected-warning {{implicit truncation from 'int' to bit-field changes value from 257 to 1}}
}
void test5() {
@@ -52,7 +52,7 @@ void test5() {
} a;
// Don't warn about this implicit conversion to bool, or at least
- // don't warn about it just because it's a bitfield.
+ // don't warn about it just because it's a bit-field.
a.b = 100;
}
@@ -71,7 +71,7 @@ void test7() {
f.twoBits1 = ~0; // no-warning
f.twoBits1 = ~1; // no-warning
- f.twoBits2 = ~2; // expected-warning {{implicit truncation from 'int' to bitfield changes value from -3 to 1}}
+ f.twoBits2 = ~2; // expected-warning {{implicit truncation from 'int' to bit-field changes value from -3 to 1}}
f.twoBits1 &= ~1; // no-warning
f.twoBits2 &= ~2; // no-warning
}
@@ -79,7 +79,7 @@ void test7() {
void test8() {
enum E { A, B, C };
struct { enum E x : 1; } f;
- f.x = C; // expected-warning {{implicit truncation from 'int' to bitfield changes value from 2 to 0}}
+ f.x = C; // expected-warning {{implicit truncation from 'int' to bit-field changes value from 2 to 0}}
}
void test9() {
@@ -128,6 +128,6 @@ void test10() {
s.a = ~0U;
s.a = ~(1<<A);
- s.a = -9; // expected-warning{{implicit truncation from 'int' to bitfield changes value from -9 to 7}}
- s.a = 16; // expected-warning{{implicit truncation from 'int' to bitfield changes value from 16 to 0}}
+ s.a = -9; // expected-warning{{implicit truncation from 'int' to bit-field changes value from -9 to 7}}
+ s.a = 16; // expected-warning{{implicit truncation from 'int' to bit-field changes value from 16 to 0}}
}
Modified: cfe/trunk/test/SemaCXX/conversion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/conversion.cpp?rev=290159&r1=290158&r2=290159&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/conversion.cpp (original)
+++ cfe/trunk/test/SemaCXX/conversion.cpp Mon Dec 19 20:43:58 2016
@@ -50,7 +50,7 @@ namespace test1 {
namespace test2 {
struct A {
unsigned int x : 2;
- A() : x(10) {} // expected-warning {{implicit truncation from 'int' to bitfield changes value from 10 to 2}}
+ A() : x(10) {} // expected-warning {{implicit truncation from 'int' to bit-field changes value from 10 to 2}}
};
}
Modified: cfe/trunk/test/SemaCXX/member-init.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/member-init.cpp?rev=290159&r1=290158&r2=290159&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/member-init.cpp (original)
+++ cfe/trunk/test/SemaCXX/member-init.cpp Mon Dec 19 20:43:58 2016
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -verify -std=c++11 -Wall %s
struct Bitfield {
- int n : 3 = 7; // expected-error {{bitfield member cannot have an in-class initializer}}
+ int n : 3 = 7; // expected-error {{bit-field member cannot have an in-class initializer}}
};
int a;
Modified: cfe/trunk/test/SemaOpenCL/unsupported.cl
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaOpenCL/unsupported.cl?rev=290159&r1=290158&r2=290159&view=diff
==============================================================================
--- cfe/trunk/test/SemaOpenCL/unsupported.cl (original)
+++ cfe/trunk/test/SemaOpenCL/unsupported.cl Mon Dec 19 20:43:58 2016
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -verify %s
struct {
- int a : 1; // expected-error {{bitfields are not supported in OpenCL}}
+ int a : 1; // expected-error {{bit-fields are not supported in OpenCL}}
};
void no_vla(int n) {
More information about the cfe-commits
mailing list