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

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 20 15:17:08 PDT 2018


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 -std=gnu89 -fsyntax-only 2>&1 | FileCheck %s
 
----------------
lebedev.ri wrote:
> This ideally needs positive tests. E.g.:
> * `-std=c89`
> * `-std=c89 -pedantic`
> * `-std=gnu99`
> * `-std=gnu99 -pedantic`
> * `-std=c99`
> * `-std=c99 -pedantic`
> 
Since `typeof` is a gnu extension, its use constitutes an error for all non gnu C standards, so it's moot to check for duplicate const specifiers from typeof exprs.

Since we're trying to match GCC's behavior here, GCC does not warn for `-std=gnu99` or `-std=gnu99 -pedantic` so I will add those test cases.


Repository:
  rC Clang

https://reviews.llvm.org/D52248





More information about the cfe-commits mailing list