Nate Begeman
be6bb8efac
Add new test
...
llvm-svn: 48018
2008-03-07 20:04:49 +00:00
Ted Kremenek
7bdd630334
Patch by Nuno Lopes:
...
Added more comments for code processing attribute "format".
Added more checks for corner cases, test cases, and warnings.
llvm-svn: 48011
2008-03-07 18:43:49 +00:00
Chris Lattner
8e48dfe9a1
move deprecated -> attributes.c
...
llvm-svn: 47856
2008-03-03 21:17:42 +00:00
Gabor Greif
76ac5cf9d3
Chris added this testcase with r47837. The mail only shows one todo-warning but I see 3. Strangeness. Correcting lines 16 and 24.
...
llvm-svn: 47840
2008-03-03 14:30:39 +00:00
Chris Lattner
8496639787
Add a bunch of attributes, patch by Nuno Lopes.
...
llvm-svn: 47837
2008-03-03 03:28:21 +00:00
Steve Naroff
b96e4ab649
Fix http://llvm.org/bugs/show_bug.cgi?id=2103 .
...
llvm-svn: 47775
2008-02-29 23:30:25 +00:00
Steve Naroff
83777fef1a
Fix http://llvm.org/bugs/show_bug.cgi?id=2106 .
...
llvm-svn: 47768
2008-02-29 21:48:07 +00:00
Chris Lattner
f4c1aa67bd
testcase for attr deprecated, by Nuno Lopes.
...
llvm-svn: 47757
2008-02-29 18:11:31 +00:00
Nate Begeman
b16d53ea31
add a test case
...
llvm-svn: 47455
2008-02-21 19:44:16 +00:00
Chris Lattner
a2417c9d8b
add some semantic checks for address spaces.
...
llvm-svn: 47423
2008-02-21 01:42:41 +00:00
Chris Lattner
d2a02fe840
fix the second half of PR2041: __restrict is ok in c90 mode, even if
...
restrict isn't.
llvm-svn: 47316
2008-02-19 06:46:10 +00:00
Steve Naroff
f631ae2cf8
Tweak fix for http://llvm.org/bugs/show_bug.cgi?id=2000 to work across typedefs.
...
llvm-svn: 47269
2008-02-18 15:14:59 +00:00
Chris Lattner
b080ed504e
Fix PR2042. One remaining issue: we don't currently diagnose
...
int foobar(int);
int foobar() {}
which requires ifdef'ing out a testcase in predefined-function.c.
llvm-svn: 47236
2008-02-17 19:31:09 +00:00
Eli Friedman
f7e92acaba
Implemnt isVariablyModifiedType correctly.
...
llvm-svn: 47233
2008-02-17 00:59:11 +00:00
Anders Carlsson
f13b1efa75
Add more tests
...
llvm-svn: 47217
2008-02-16 19:51:36 +00:00
Anders Carlsson
3ea23a45d9
Make sizeof and __alignof work correctly with packed structs.
...
llvm-svn: 47202
2008-02-16 01:20:23 +00:00
Chris Lattner
287c734075
Fix PR2041: restrict is not a keyword in c90.
...
llvm-svn: 47160
2008-02-15 18:02:59 +00:00
Eli Friedman
78e47634b2
Get rid of outdated code that masks type errors. Fixes PR2036.
...
llvm-svn: 47154
2008-02-15 06:56:02 +00:00
Eli Friedman
e9d0954c06
Nevermind, these tests work... I messed up my testing.
...
llvm-svn: 47153
2008-02-15 06:29:53 +00:00
Eli Friedman
a01cfa75eb
Partial fix for struct compatibility; there's still something messy
...
going on with mixing scopes, though.
llvm-svn: 47152
2008-02-15 06:03:44 +00:00
Steve Naroff
f631997cb5
A much better fix for http://llvm.org/bugs/show_bug.cgi?id=1987 .
...
llvm-svn: 47103
2008-02-14 02:58:32 +00:00
Eli Friedman
2be9af9556
Fix a minor bug in isNullPointerConstant triggered by the linux
...
tgmath.h.
Note that there is another issue with tgmath.h, so mandel.c still
doesn't work.
llvm-svn: 47069
2008-02-13 17:29:58 +00:00
Eli Friedman
a7bf7ed476
Make typechecking for enum+int compatibility stricter.
...
llvm-svn: 47005
2008-02-12 08:46:17 +00:00
Eli Friedman
16f909670e
Fix type compatibility between constant and variable arrays.
...
llvm-svn: 47003
2008-02-12 08:23:06 +00:00
Steve Naroff
ab468cb14b
Allow the parser to detect invalid DeclSpec's. This fixes http://llvm.org/bugs/show_bug.cgi?id=1987 .
...
This commit only "guards" the call to ParseDeclarationSpecifiers() in ParseDeclarationOrFunctionDefinition().
We could consider guarding all calls, however this is a bit radical (since it effectively stops parsing the declaration once we have a bad declspec). Will discuss with Chris tomorrow.
llvm-svn: 46984
2008-02-12 04:08:59 +00:00
Anders Carlsson
6a8350b4f1
Get rid of bogus warnings when the second argument in va_start is either an implicit cast expr or a paren expr.
...
llvm-svn: 46950
2008-02-11 04:20:54 +00:00
Steve Naroff
e78e2af754
Tweak test...
...
llvm-svn: 46946
2008-02-11 02:16:41 +00:00
Steve Naroff
326389b8ce
Fix http://llvm.org/bugs/show_bug.cgi?id=1988 .
...
Sema::CheckInitializerListTypes() needs to ignore invalid structures.
llvm-svn: 46942
2008-02-11 00:06:17 +00:00
Chris Lattner
36fc8790b7
Fix PR1992 by computing the right type for string literals, which
...
is an array type not a pointer type. This requires updating some
diags that change and updating the code generator to handle the
proper form of strings.
llvm-svn: 46941
2008-02-11 00:02:17 +00:00
Eli Friedman
fadc8462be
Add a couple of sema tests for qualifiers with conditionals containing
...
void*.
llvm-svn: 46939
2008-02-10 23:14:16 +00:00
Chris Lattner
7b8134f5c6
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.
llvm-svn: 46938
2008-02-10 23:08:00 +00:00
Steve Naroff
1018ea35b7
Refine bug fix to Expr::isLvalue (commit r46917).
...
llvm-svn: 46919
2008-02-10 01:39:04 +00:00
Steve Naroff
43c50866f1
Change Expr::isLvalue() to allow the "void" type. This fixes bz2000 submitted by Neil Booth.
...
Neil, can you point me to the place in the C99 spec that says this is allowed? I thought Expr::isLvalue() conformed to the spec, which says "C99 6.3.2.1: an lvalue is an expression with an object type or an incomplete type other than void.". Please advise.
llvm-svn: 46917
2008-02-10 00:30:18 +00:00
Steve Naroff
45173e0ac0
Fix <rdar://problem/5733511> clang doesn't emit error for const array.
...
llvm-svn: 46905
2008-02-09 16:59:44 +00:00
Steve Naroff
a369922449
A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete
...
As part of this fix, I made a low-level change to the text diagnostics machinery (to basically avoid printing duplicate source lines/carets when you have multiple diagnostics that refer to the same exact place). For now, this only happens with we don't have a source range (could be extended to support source ranges as well).
llvm-svn: 46897
2008-02-08 22:06:17 +00:00
Steve Naroff
8c099c3f03
Use getLogicalLineNumber() in FuzzyParseMicrosoftAsmStatement(), it's more general and simplifies the code.
...
llvm-svn: 46885
2008-02-08 18:01:27 +00:00
Steve Naroff
db5f7d7699
Support fuzzy parsing MS line-oriented __asm's that originate from a macro (a case where we can't obtain source line info). As the test case indicates, we don't currently support line-oriented asm statements that mix file/macro body tokens.
...
llvm-svn: 46878
2008-02-08 03:36:19 +00:00
Eli Friedman
4297826cac
Improve diagnostic for illegal array initialization.
...
llvm-svn: 46869
2008-02-08 00:48:24 +00:00
Eli Friedman
1242fff6ec
Make sure to propagate qualifiers through the member operator.
...
llvm-svn: 46830
2008-02-06 22:48:16 +00:00
Eli Friedman
d49a720d52
Be a bit stricter about array type compatibility.
...
llvm-svn: 46799
2008-02-06 04:53:22 +00:00
Chris Lattner
c43926fe67
Implement support for __extension__ which silences extwarnings in its
...
scope. This is part of the fix for PR1966
llvm-svn: 46669
2008-02-02 20:20:10 +00:00
Ted Kremenek
e9a709a0c5
Moved "Rewriter" tests from test/Sema to test/Rewriter.
...
llvm-svn: 46640
2008-02-01 17:05:54 +00:00
Anders Carlsson
806700f973
It is allowed to get the address of an array subscript, even if the array has the register qualifier, if the array is really a pointer.
...
llvm-svn: 46634
2008-02-01 07:15:58 +00:00
Chris Lattner
a347834869
make some diagnostics more terse, update testcases.
...
Fix Sema::ActOnInstanceMessage to correctly do things in terms of canonical
types, fixing bogus errors like:
NSDistantObject.m:10383:120: error: bad receiver type 'typeof((id<NSMutableCopying>)self)'
id mess = ({ id __inv__ = ((void *)0); id __mb__ = _NSMessageBuilder((id <NSMutableCopying>)self, &__inv__); (void)[(__typeof__((id <NSMutableCopying>)self))__mb__ mutableCopyWithZone:((void *)0)]; if (!objc_collecting_enabled()) object_dispose(__mb__); __inv__; });
llvm-svn: 46633
2008-02-01 06:57:39 +00:00
Chris Lattner
4973fb9273
Fix a bogus test
...
llvm-svn: 46602
2008-01-31 06:06:29 +00:00
Chris Lattner
a779d69029
Fix a rewriter crash when the whole body of a foreach is itself
...
rewritten, as in Sema/rewrite-foreach-6.m. Fariborz/Steve,
please review this to see if it is sane.
llvm-svn: 46600
2008-01-31 05:10:40 +00:00
Steve Naroff
2a2c5b98ee
Fix test case and add a FIXME.
...
llvm-svn: 46577
2008-01-30 21:50:43 +00:00
Chris Lattner
e850fa2452
make this pass by adding an expected error, add some tests.
...
llvm-svn: 46551
2008-01-30 06:46:30 +00:00
Steve Naroff
1e7873642b
Many refinements to Sema::MergeVarDecl(). This routine still needs some re-work to fully handle tentative decls.
...
This includes a fix to bz1908.
llvm-svn: 46540
2008-01-30 00:44:01 +00:00
Fariborz Jahanian
284011b462
Rewriting of @synchronized. This has one FIXME in it. But this should allow @sychronized to be rewritten.
...
llvm-svn: 46533
2008-01-29 22:59:37 +00:00