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

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 24 09:43:37 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
 
----------------
nickdesaulniers wrote:
> nickdesaulniers wrote:
> > 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.
> https://godbolt.org/z/3trZdl
Ah, I can still put CHECKs for errors.  Will add additional tests.


Repository:
  rC Clang

https://reviews.llvm.org/D52248





More information about the cfe-commits mailing list