[Issue 22339] New: importC: error message with character literal reports as integer instead of character literal.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Sep 28 04:19:32 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22339
Issue ID: 22339
Summary: importC: error message with character literal reports
as integer instead of character literal.
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dave287091 at gmail.com
The following erroneous C program gives an unusual error message:
// err.c
int bar(void){
switch('1'){
case.'1': // erroneous . instead of a space
break;
}
return 0;
}
err.c(4): Error: expression expected, not `.`
err.c(4): Error: found `49` when expecting `:`
err.c(4): Error: found `:` instead of statement
I expected the second error to be reported as a character literal, not as the
integer value of the character literal.
I can also trigger it in the following situations:
enum {foo = .'1'};
switch(.'1')
--
More information about the Digitalmars-d-bugs
mailing list