Clang error: illegal type A used in a boxed expression (err_objc_illegal_boxed_expression_type)
Jump to navigation
Jump to search
Text | error: illegal type A used in a boxed expression |
---|---|
Type | Error |
Category | Semantic Issue |
Internal Id | err_objc_illegal_boxed_expression_type |
Internal Message | illegal type %0 used in a boxed expression
|
Regular Expression | (?:error|fatal error)\: illegal type (.*?) used in a boxed expression
|
First Commit | 2012-04-19 0caa39474bfc Implements boxed expressions for Objective-C. <rdar://problem/10194391> |
Description
Example
Flags | -xobjective-c
|
|
---|---|---|
Source |
@interface C; // Incomplete type definition
int main() {
@((C*)0); // Illegal type used in boxed expression
return 0;
}
| |
Compiler Output |
<source>:3:5: warning: function definition inside an Objective-C container is deprecated [-Wfunction-def-in-objc-container] <source>:4:3: error: illegal type 'C *' used in a boxed expression <source>:6:2: error: missing '@end' <source>:1:1: note: class started here |
Clang Internals (17.0.6)
Git Commit Message
Implements boxed expressions for Objective-C. <rdar://problem/10194391> llvm-svn: 155082
Used in Clang Sources
This section lists all occurrences of the diagnostic within the Clang's codebase. For each occurrence, an auto-extracted snipped from the source code is listed including key elements like control structures, functions, or classes. It should illustrate the conditions under which the diagnostic is activated.
clang/lib/Sema/SemaExprObjC.cpp (line 731)
ExprResult Sema::BuildObjCBoxedExpr(SourceRange SR, Expr *ValueExpr) {
// ...
if (!BoxingMethod) {
Diag(Loc, diag::err_objc_illegal_boxed_expression_type) << ValueType << ValueExpr->getSourceRange();
Triggered in Clang Tests
This section lists all internal Clang test cases that trigger the diagnostic.
clang/test/SemaObjC/objc-literal-nsnumber.m
- clang/test/SemaObjC/objc-literal-nsnumber.m:16:13: error: illegal type 'int' used in a boxed expression
- clang/test/SemaObjC/objc-literal-nsnumber.m:26:13: error: illegal type 'int' used in a boxed expression