https://bugs.llvm.org/show_bug.cgi?id=49413

Richard Smith <richard-l...@metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---
                 CC|                            |aa...@aaronballman.com

--- Comment #3 from Richard Smith <richard-l...@metafoo.co.uk> ---
The error is not produced in -x objective-c nor in -x objective-c++.

The 'enum name : underlying' syntax is not valid at all in C. As a Clang
extension, we permit the C++ language feature in C as well, so the error is
produced in -x c++ and in -x c. Apparently we produce no diagnostic for that
extension by default (for cases that are valid in C++), but all uses of 'enum E
: underlying' are rejected in -x c under -pedantic-errors at least.

Perhaps it would be better if, under -x c, we produced the warning for 'enum
name : underlying' being a Clang extension by default, instead of silently
accepting the invalid code. If we do, then producing a second extension
diagnostic for nesting such an enum in a typedef seems unnecessary and we could
turn that off for C compilations (effectively meaning that the C extension
picks up the Objective-C feature, not the similar-but-more-constraining C++
feature).

Aaron, as our champion of C conformance, what do you think? Silently accepting
this C++ feature in C by default seems at least questionable to me.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to