[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-10-03 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Created: https://reviews.llvm.org/D52849 Repository: rC Clang https://reviews.llvm.org/D52248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-10-03 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers abandoned this revision. nickdesaulniers added a comment. Well that didn't do what I wanted...(sorry, still learning arc). Going to abandon this and push a much simpler fix. Repository: rC Clang https://reviews.llvm.org/D52248

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-10-03 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 168183. nickdesaulniers added a comment. [SEMA] split ExtWarn dupl-decl-spec's into Extension and ExtWarn For types deduced from typedef's and typeof's, don't warn for duplicate declaration specifiers in C90 unless -pedantic. Create a third

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-10-01 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: lib/Sema/DeclSpec.cpp:441-442 else -DiagID = IsExtension ? diag::ext_duplicate_declspec : - diag::warn_duplicate_declspec; +DiagID = IsExtension ? diag::ext_duplicate_declspec +

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-10-01 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. Downgrading the C89 warning for duplicate qualifiers from typedefs / __typeof from `ExtWarn` to `Extension` seems very reasonable to me. However, I don't see a justification for removing the warning for duplicate explicit (non-typedef) qualifiers in C99, nor for

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-10-01 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 167845. nickdesaulniers marked an inline comment as done. nickdesaulniers added a comment. - move back untouched test case Repository: rC Clang https://reviews.llvm.org/D52248 Files: include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-10-01 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 167843. nickdesaulniers marked 2 inline comments as done. nickdesaulniers added a comment. - add back test for typedef typedef - add test for dupl _Atomic and restrict Repository: rC Clang https://reviews.llvm.org/D52248 Files:

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-10-01 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers marked an inline comment as done. nickdesaulniers added inline comments. Comment at: test/FixIt/fixit.c:50 -// CHECK: const typedef int int_t; -const typedef typedef int int_t; // expected-warning {{duplicate 'typedef'}} - nickdesaulniers wrote:

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-28 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: test/FixIt/fixit.c:50 -// CHECK: const typedef int int_t; -const typedef typedef int int_t; // expected-warning {{duplicate 'typedef'}} - Ah, this was a case I should add one last test for. I think reviewers

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-28 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Ok, I think this is ready for rereview. Comment at: test/Parser/atomic.c:5 typedef _Atomic int atomic_int; -typedef _Atomic _Atomic _Atomic(int) atomic_int; // expected-warning {{duplicate '_Atomic' declaration specifier}}

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-28 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 167565. nickdesaulniers added a comment. Herald added a subscriber: jfb. - split duplicate_declspec into Extension and Extwarn from Extwarn. - rename ext_duplicate_declspec to be the Extension, not the Extwarn. - Fix C++ case. - Use tablegen'd

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-25 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. The right way to produce diagnostics under pedantic mode is to model them as Extension or ExtWarn in the .td file, not by checking the Pedantic diagnostic option directly. If this is an intentional GNU extension too, that makes things a bit more complex (one approach

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-25 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. > Should GCC instead warn for the typedef case for -std=c89 (non pedantic), > according to C90 6.5.3? Seems like yes: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80868#c6 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87435 But let's wait a bit to see what the

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-24 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. This now matches GCC AFAICT. My only question is: Should GCC instead warn for the typedef case for -std=c89 (non pedantic), according to C90 6.5.3? Repository: rC Clang https://reviews.llvm.org/D52248 ___

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-24 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166743. nickdesaulniers added a comment. - adjust wording in comment Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89-const.c Index: test/Sema/gnu89-const.c

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-24 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166742. nickdesaulniers added a comment. - fix typo s/CNU/GNU/g and update NOTEs Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89-const.c Index: test/Sema/gnu89-const.c

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-24 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: test/Sema/gnu89-const.c:41-46 +CHECK-CNU99-NOT: 27:1: warning: duplicate 'const' declaration specifier +CHECK-CNU99-PEDANTIC-NOT: 27:1: warning: duplicate 'const' declaration specifier +CHECK-CNU11-NOT: 27:1: warning: duplicate

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-24 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166740. nickdesaulniers added a comment. - condense CHECK-prefixes into CHECK for const const Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89-const.c Index: test/Sema/gnu89-const.c

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-24 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166736. nickdesaulniers added a comment. - add ISO C tests, handle typedef case new tests found Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89-const.c Index: test/Sema/gnu89-const.c

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-24 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166737. nickdesaulniers added a comment. - remove debug statments Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89-const.c Index: test/Sema/gnu89-const.c

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-24 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: test/Sema/gnu89.c:1-2 -// RUN: %clang_cc1 %s -std=gnu89 -pedantic -fsyntax-only -verify +// RUN: %clang_cc1 %s -std=gnu89 -pedantic -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-PEDANTIC %s +// RUN: %clang_cc1 %s

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: lib/Sema/SemaType.cpp:1682 // or via one or more typedefs." -if (!S.getLangOpts().C99 && !S.getLangOpts().CPlusPlus -&& TypeQuals & Result.getCVRQualifiers()) { srhines wrote: > This is broken

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166578. nickdesaulniers marked an inline comment as done. nickdesaulniers added a comment. - also run test on gnu99+ Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89-const.c Index:

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166351. nickdesaulniers added a comment. - warn only if -pedantic, add gcc bug test cases Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89.c Index: test/Sema/gnu89.c

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: test/Sema/gnu89.c:1-2 -// RUN: %clang_cc1 %s -std=gnu89 -pedantic -fsyntax-only -verify +// RUN: %clang_cc1 %s -std=gnu89 -pedantic -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-PEDANTIC %s +// RUN: %clang_cc1 %s

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: test/Sema/gnu89.c:1-2 -// RUN: %clang_cc1 %s -std=gnu89 -pedantic -fsyntax-only -verify +// RUN: %clang_cc1 %s -std=gnu89 -pedantic -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-PEDANTIC %s +// RUN: %clang_cc1 %s

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-20 Thread Stephen Hines via Phabricator via cfe-commits
srhines added inline comments. Comment at: lib/Sema/SemaType.cpp:1682 // or via one or more typedefs." -if (!S.getLangOpts().C99 && !S.getLangOpts().CPlusPlus -&& TypeQuals & Result.getCVRQualifiers()) { This is broken for C11 and C17 (even

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166357. nickdesaulniers added a comment. - add line numbers to match specific warning lines Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89-const.c Index: test/Sema/gnu89-const.c

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166355. nickdesaulniers added a comment. - move test to new file, use check-prefix for both cases Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89-const.c Index: test/Sema/gnu89-const.c

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-20 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: test/Sema/gnu89.c:1-2 -// RUN: %clang_cc1 %s -std=gnu89 -pedantic -fsyntax-only -verify +// RUN: %clang_cc1 %s -std=gnu89 -pedantic -fsyntax-only 2>&1 | FileCheck -check-prefix=CHECK-PEDANTIC %s +// RUN: %clang_cc1 %s -std=gnu89

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-20 Thread Manoj Gupta via Phabricator via cfe-commits
manojgupta added a comment. lgtm. But someone more familiar with these code paths should approve. Repository: rC Clang https://reviews.llvm.org/D52248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166352. nickdesaulniers added a comment. - git-clang-format HEAD~ Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89.c Index: test/Sema/gnu89.c

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-19 Thread Manoj Gupta via Phabricator via cfe-commits
manojgupta added a comment. As per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80868, I thought GCC also emits this error but only with -pedantic. So probably should keep this error but under -Wextra or another appropriate group? Repository: rC Clang https://reviews.llvm.org/D52248

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-19 Thread Joel Stanley via Phabricator via cfe-commits
joel added a comment. I built Linux using this patch applied to trunk and it worked for me. Thanks! Repository: rC Clang https://reviews.llvm.org/D52248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-18 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 166035. nickdesaulniers added a comment. git-clang-format HEAD~ Repository: rC Clang https://reviews.llvm.org/D52248 Files: lib/Sema/SemaType.cpp test/Sema/gnu89.c Index: test/Sema/gnu89.c

[PATCH] D52248: [SEMA] ignore duplicate declaration specifiers from typeof exprs

2018-09-18 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers created this revision. nickdesaulniers added reviewers: srhines, gbiv. Herald added a reviewer: george.burgess.iv. Herald added a subscriber: cfe-commits. nickdesaulniers removed a reviewer: gbiv. Fixes PR32985. Repository: rC Clang https://reviews.llvm.org/D52248 Files: