History log of /external/clang/test/Parser/declarators.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e37cf1b0795c4d68dd0bbd9a902deb8d9677c3f8 26-Aug-2010 John McCall <rjmccall@apple.com> ...I forgot to check my new test after adding it, and lo, there's slightly different
behavior in C than in C++ (which is what the original test case was).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
55ff5846f30290119058058a4b7eefa81ef102ea 26-Aug-2010 John McCall <rjmccall@apple.com> Make sure we clear TypeSpecOwned when setting TypeSpecType to something when
it might previously have been a tag TST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
f93ade3b00ac28866fc44072fae3c3daaaa75d61 12-Jul-2010 Chris Lattner <sabre@nondot.org> change the 'invalid token after top level declarator' message to be
'expected ';' after top level declarator' which is much less vague.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108106 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
caeb5603066581b06d0cc5c0b7b6816a900bb2f7 12-Jul-2010 Chris Lattner <sabre@nondot.org> Fix PR7617 by not entering ParseFunctionDefinition when
a function prototype is followed by a declarator if we
aren't parsing a K&R style identifier list.

Also, avoid skipping randomly after a declaration if a
semicolon is missing. Before we'd get:

t.c:3:1: error: expected function body after function declarator
void bar();
^

Now we get:

t.c:1:11: error: invalid token after top level declarator
void foo()
^
;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
e8bea49f660411d2a1fd1c58cf47534c80f06da8 31-May-2010 Douglas Gregor <doug.gregor@gmail.com> Don't try to parse class template specializations in C. It can only
lead to heartache. Fixes <rdar://problem/8044088>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
06b452bc5cfcd82a80f49865500c8526fb9b4c15 09-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Improve diagnostics when we fail to convert from a source type to a
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as

t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
expected 'char *' [-pedantic]
char *name = __func__;
^ ~~~~~~~~

We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:

t.c:2:9: warning: initializing 'char *' from an expression of type
'char const [2]' discards qualifiers [-pedantic]
char *name = __func__;
^ ~~~~~~~~

Fixes <rdar://problem/7447179>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
e06c21b075a36f8f2a46df1385035be7cef85a1e 14-Feb-2010 John McCall <rjmccall@apple.com> Improve the diagnostic given when referring to a tag type without a tag (in C)
or that's been hidden by a non-type (in C++).

The ideal C++ diagnostic here would note the hiding declaration, but this
is a good start.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
f85d9f8bcc8080a9e0c1dc24880cc869b729e30f 03-Feb-2010 Chris Lattner <sabre@nondot.org> Declarators can have grouping parens. This fixes rdar://7608537.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
d04e1ec243690bd7af3af7f626cf4ef28f54daab 03-Feb-2010 Chris Lattner <sabre@nondot.org> fix PR6216


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95185 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
74b8aaa03529ed187e5535a6bc27aa55218021e7 02-Feb-2010 Chris Lattner <sabre@nondot.org> the declspec of a declaration can have storage-class specifiers,
type qualifiers and type specifiers in any order. For example,
this is valid: struct x {...} typedef y;

This fixes PR6208.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
95561ea54ef955f635d84f3d1512b049914fff1c 02-Feb-2010 Chris Lattner <sabre@nondot.org> improve diagnostics on missing ; in a struct. Before:

t.c:4:3: error: expected ';' at end of declaration list
int y;
^
t.c:4:8: warning: extra ';' inside a struct or union
int y;
^
t.c:6:1: warning: expected ';' at end of declaration list
};
^

After:

t.c:3:8: error: expected ';' at end of declaration list
int x // expected-error {{expected ';' at end of declaration list}}
^
;
t.c:5:8: warning: expected ';' at end of declaration list
int z
^
;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
3573b2c84372d9484296fa658f5276f6c09acb92 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
7131efac8bde4971fe418660365c7693b03e9ad3 22-Jul-2009 Mike Stump <mrs@apple.com> Prep for new warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
e695d8c916919c401f324e02d1c1b3675ddf9f2c 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Simplify the scheme used for keywords, and change the classification
scheme to be more useful.

The new scheme introduces a set of categories that should be more
readable, and also reflects what we want to consider as an extension
more accurately. Specifically, it makes the "what is a keyword"
determination accurately reflect whether the keyword is a GNU or
Microsoft extension.

I also introduced separate flags for keyword aliases; this is useful
because the classification of the aliases is mostly unrelated to the
classification of the original keyword.

This patch treats anything that's in the implementation
namespace (prefixed with "__", or "_X" where "X" is any upper-case
letter) as a keyword without marking it as an extension. This is
consistent with the standards in that an implementation is allowed to define
arbitrary extensions in the implementation namespace without violating
the standard. This gets rid of all the nasty "extension used" warnings
for stuff like __attribute__ in -pedantic mode. We still warn for
extensions outside of the the implementation namespace, like typeof.
If someone wants to implement -Wextensions or something like that, we
could add additional information to the keyword table.

This also removes processing for the unused "Boolean" language option;
such an extension isn't supported on any other C implementation, so I
don't see any point to adding it.

The changes to test/CodeGen/inline.c are required because previously, we
weren't actually disabling the "inline" keyword in -std=c89 mode.

I'll remove Boolean and NoExtensions from LangOptions in a follow-up
commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
b8f746865cb6dde04d4d03557be5ccad693a8a81 13-Apr-2009 Chris Lattner <sabre@nondot.org> fix another case that assumed that GetTypeForDeclarator would never return null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
8506691a75c0f01586862ad3cf71740c1f422c78 13-Apr-2009 Chris Lattner <sabre@nondot.org> mark the declspec as invalid when we recover instead of forcing to int,
this allows downstream diags to be properly silenced.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68917 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
197b4343435266ed64cbed114d030078292cdd6f 12-Apr-2009 Chris Lattner <sabre@nondot.org> Diagnose invalid uses of tagged types with a missing tag. For example, in:

struct xyz { int y; };
enum abc { ZZZ };

static xyz b;
abc c;

we used to produce:

t2.c:4:8: error: unknown type name 'xyz'
static xyz b;
^
t2.c:5:1: error: unknown type name 'abc'
abc c;
^

we now produce:

t2.c:4:8: error: use of tagged type 'xyz' without 'struct' tag
static xyz b;
^
struct
t2.c:5:1: error: use of tagged type 'abc' without 'enum' tag
abc c;
^
enum

GCC produces the normal:
t2.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘b’
t2.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’

rdar://6783347


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
cc98d8c25806d02561d5b64cfd78740c8150538f 12-Apr-2009 Chris Lattner <sabre@nondot.org> Implement the first set of changes for PR3963 and rdar://6759604,
which tries to do better error recovery when it is "obvious" that an
identifier is a mis-typed typename. In this case, we try to parse
it as a typename instead of as the identifier in a declarator, which
gives us several options for better error recovery and immediately
makes diagnostics more useful. For example, we now produce:

t.c:4:8: error: unknown type name 'foo_t'
static foo_t a = 4;
^

instead of:

t.c:4:14: error: invalid token after top level declarator
static foo_t a = 4;
^

Also, since we now parse "a" correctly, we make a decl for it,
preventing later uses of 'a' from emitting things like:

t.c:12:20: error: use of undeclared identifier 'a'
int bar() { return a + b; }
^

I'd really appreciate any scrutiny possible on this, it
is a tricky area.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
ffd408a50adb01ae9c0ad92fb5f0981e1ca72df5 24-Mar-2009 Daniel Dunbar <daniel@zuster.org> Rename clang to clang-cc.

Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
cd61d5956afb6505f91fc1240d2e3cd6cfc59fae 11-Nov-2008 Chris Lattner <sabre@nondot.org> Fix PR3031 by silencing follow-on errors in invalid declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
c337fa2669e893a52a3598d2e62f024a5786a912 06-Apr-2008 Chris Lattner <sabre@nondot.org> reject 'int test(x, x) int x; {}'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
acb67d91c95c76e18f26e994e927a8b733fa16aa 06-Apr-2008 Chris Lattner <sabre@nondot.org> reject 'typedef int y; int test(x, y)'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
6ab935ba6195062045a0921cd519d520a9216b50 05-Apr-2008 Chris Lattner <sabre@nondot.org> Fix handling of implicit int, resolving PR2012 and reverting (and
subsuming) my patch for PR1999.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
871fd79d634934b8a7d1c61ed6ee3d1ce9a2f19d 11-Feb-2008 Chris Lattner <sabre@nondot.org> Fix PR1999, by emitting a hard error only if an argument declarator is completely
missing. Otherwise, it is an implicit int case, which is valid in c90 and invalid
elsewhere, but accepted as an extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
e5db29f53fdc9f1fa5a535dfa6ca8e43e21e56df 31-Jan-2008 Chris Lattner <sabre@nondot.org> Fix PR1965: missing diagnostics for parameters that are missing
type specifiers. This required updating some (buggy) tests, and the
testcase was previously accidentally committed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
bccfc15cd323bbb250f560481340f81cc71d4ebc 19-Dec-2007 Chris Lattner <sabre@nondot.org> reenable this code, fix the testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45205 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c
4b0096578e961587d1ec0ed5dce45f592a65ed41 25-Jul-2007 Chris Lattner <sabre@nondot.org> Fix a couple of bugs, add some new cool stuff.

1. Fix a todo in Parser::ParseTag, to recover better. On code like
that in test/Sema/decl-invalid.c it causes us to return a single
error instead of multiple.
2. Fix an error in Sema::ParseDeclarator, where it would crash if the
declarator didn't have an identifier. Instead, diagnose the problem.
3. Start adding infrastructure to track the range of locations covered
by a declspec or declarator. This is mostly implemented for declspec,
but could be improved, it is missing for declarator.

Thanks to Neil for pointing out this crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Parser/declarators.c