LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 21524 - diagnostics missing from -Wc++-compat
Summary: diagnostics missing from -Wc++-compat
Status: NEW
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-10 21:46 PST by Richard Smith
Modified: 2014-11-10 21:46 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Smith 2014-11-10 21:46:06 PST
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
             ^