Skip to content

diagnostics missing from -Wc++-compat #21898

Closed
@zygoloid

Description

@zygoloid
Bugzilla Link 21524
Version trunk
OS Linux
CC @DougGregor

Extended Description

From http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-November/039875.html

clang doesn't print warning for following test-case:

compiled with: clang -fsyntax-only -Wc++-compat

int new;
struct A
{
struct B
{
int x;
}bs;
int y;
};
struct B b;

gcc -fsyntax-only -Wc++-compat prints following warnings (gcc-4.9.1 ubuntu):

t.c:1:5: warning: identifier ‘new’ conflicts with C++ keyword [-Wc++-compat]
int new;
^
t.c:13:8: warning: struct defined in struct or union is not visible in
C++ [-Wc++-compat]
struct B b;
^
t.c:5:10: note: struct defined here
struct B
^

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillacc++clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second party

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions