blob: 7b5095f6e92374f531acbe87322796c49c4b47dc [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify -pedantic %s
Steve Naroffb4eaf9c2008-09-02 18:50:17 +00002
3// The preprocessor shouldn't warn about extensions within macro bodies that
4// aren't expanded.
Eli Friedmaneb32fde2009-04-28 03:13:54 +00005#define TY typeof
6#define TY1 typeof(1)
Steve Naroffb4eaf9c2008-09-02 18:50:17 +00007
Eli Friedmaneb32fde2009-04-28 03:13:54 +00008// But we should warn here
9TY1 x; // expected-warning {{extension}}
10TY(1) x; // FIXME: And we should warn here
11
12// Note: this warning intentionally doesn't trigger on keywords like
13// __attribute; the standard allows implementation-defined extensions
14// prefixed with "__".
15// Current list of keywords this can trigger on:
16// inline, restrict, asm, typeof, _asm
Steve Naroffb4eaf9c2008-09-02 18:50:17 +000017
18void whatever() {}