Clang warning: plain '_Complex' requires a type specifier; assuming '_Complex double' (ext_plain_complex)
Jump to navigation
Jump to search
Text | error: plain '_Complex' requires a type specifier; assuming '_Complex double' |
---|---|
Type | Warning |
Category | Semantic Issue |
Internal Id | ext_plain_complex |
Active by Default | Yes |
Internal Message | plain '_Complex' requires a type specifier; assuming '_Complex double'
|
Regular Expression | (?:warning|error|fatal error)\: plain '_Complex' requires a type specifier; assuming '_Complex double'(?: \[(?:\-Werror)?[^\]]*\])?
|
First Commit | 2009-03-04 b1c4d5507fad The basic representation of diagnostics information in tablegen format, plus (uncommented and incomp... |
Description
Example
Flags | -xc
|
|
---|---|---|
Source |
#include <complex.h>
int main() {
_Complex x; // Missing type specifier
return 0;
}
| |
Compiler Output |
<source>:4:3: warning: plain '_Complex' requires a type specifier; assuming '_Complex double' |
Clang Internals (17.0.6)
Git Commit Message
The basic representation of diagnostics information in tablegen format, plus (uncommented and incomplete) test conversions of the existing def files to this format. llvm-svn: 66064
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/DeclSpec.cpp (line 1306)
/// Finish - This does final analysis of the declspec, rejecting things like
/// "_Imaginary" (lacking an FP type). After calling this method, DeclSpec is
/// guaranteed to be self-consistent, even if an error occurred.
void DeclSpec::Finish(Sema &S, const PrintingPolicy &Policy) {
// ...
// TODO: if the implementation does not implement _Complex or _Imaginary,
// disallow their use. Need information about the backend.
if (TypeSpecComplex != TSC_unspecified) {
if (TypeSpecType == TST_unspecified) {
S.Diag(TSCLoc, diag::ext_plain_complex) << FixItHint::CreateInsertion(S.getLocForEndOfToken(getTypeSpecComplexLoc()), " double");
Triggered in Clang Tests
This section lists all internal Clang test cases that trigger the diagnostic.
clang/test/FixIt/fixit-recompile.c
- clang/test/FixIt/fixit-recompile.c:4:1: error: plain '_Complex' requires a type specifier; assuming '_Complex double' [-Werror]