[llvm-bugs] [Bug 39928] New: Fails to detect redefinition of struct when nesting in C11 program.
via llvm-bugs
llvm-bugs at lists.llvm.org
Sun Dec 9 04:24:22 PST 2018
https://bugs.llvm.org/show_bug.cgi?id=39928
Bug ID: 39928
Summary: Fails to detect redefinition of struct when nesting in
C11 program.
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: anders.granlund.0 at gmail.com
CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
neeilans at live.com, richard-llvm at metafoo.co.uk
Consider the following C11 program (prog.c):
int main()
{
struct S { struct S { int a; } b; };
}
It was compiled with the following command line:
clang prog.c -std=c11 -pedantic-errors "-w"
The expected behaviour was to get an error about redefinition of the struct S,
but no errors are given. The two struct definitions are in the same scope
(block scope) so they should conflict. There are no struct scopes in C11.
Note that gcc gives the expected error.
Online compiler link: https://wandbox.org/permlink/JeT9d5XpZLOxJLuj
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181209/6a31eaa6/attachment-0001.html>
More information about the llvm-bugs
mailing list