[LLVMbugs] [Bug 21524] New: diagnostics missing from -Wc++-compat

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 10 19:46:06 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=21524

            Bug ID: 21524
           Summary: diagnostics missing from -Wc++-compat
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

>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
             ^

-- 
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/20141111/a25c9c14/attachment.html>


More information about the llvm-bugs mailing list