http://llvm.org/bugs/show_bug.cgi?id=18041
Bug ID: 18041
Summary: Inconsistent handling of C++ comments in C89 mode
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
I compiled three test codes with -std=c89 compiler option.
(A)
int main(void)
{
//
return 0;
}
(B)
int main(void)
{
//
//*
return 0;
}
(C)
int main(void)
{
//*
return 0;
}
Code (A) compiles fine with a warning
a.c:3:5: warning: // comments are not allowed in this language [-Wcomment]
Code (B) behaves in the same way as (A).
Code (C) fails to compile with the following errors:
c:3:5: error: expected expression
//*
^
c:3:6: error: unterminated /* comment
//*
^
The behavior of Code (C) is inconsistent with those of Codes (A) and (B).
Tested on clang trunk.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs