[PATCH] D12686: Add support for GCC's '__auto_type' extension.
Vedant Kumar via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 11 18:16:51 PDT 2015
vsk added a subscriber: vsk.
vsk added a comment.
First off, welcome! And thanks for patch.
This basically LGTM, but I have one small change I'd like to see (inline comment).
Hm, the spec says "The sizeof operator shall not be applied to... an lvalue that designates a bit-field". Sounds like a bug to me.
================
Comment at: lib/Sema/SemaType.cpp:2698
@@ -2693,1 +2697,3 @@
+ const unsigned Keyword =
+ D.getDeclSpec().getTypeSpecType() - DeclSpec::TST_auto;
SemaRef.Diag(AutoRange.getBegin(), diag::err_auto_not_allowed)
----------------
Hm, this is a little hard to read. IIUC it's also sensitive to re-ordering of enum values. I'd be happier if you introduced a switch here, and made the LHS enum type explicit.
================
Comment at: test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3-1y.cpp:4
@@ -3,3 +3,3 @@
// FIXME: This is in p11 (?) in C++1y.
void f() {
----------------
Do you know what this FIXME alludes to? Seems rather mysterious to me.
http://reviews.llvm.org/D12686
More information about the cfe-commits
mailing list