llvm-project/clang/test/Sema
Chris Lattner 58418ffa32 Make ProcessDeclAttributes walk the declarator structure pulling
decl attributes out of the various places they can hide.  This makes
us correctly reject things like this:

t.c:2:22: error: mode attribute only supported for integer and floating-point types
  int **__attribute((mode(HI)))* i32;
                     ^

because you can't make a pointer be HImode.

llvm-svn: 52876
2008-06-29 00:16:31 +00:00
..
DoubleMethod.m Patch to diagnose duplicate method implementations. 2007-10-16 21:52:23 +00:00
address-constant.c PR1963: Address of function is a constant expression 2008-04-04 09:45:30 +00:00
address_spaces.c Extend QualType::getAddressSpace to do the right thing for array types, and in 2008-03-25 18:36:32 +00:00
alias-test-1.m Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass (to inherit from NamedDecl, instead of ScopedDecl). 2008-04-01 23:04:06 +00:00
alias-test-2.m Fixed a @compatible_alias bug. In the process, discovered unnecessary 2ndry lookup 2007-10-12 19:38:20 +00:00
annotate.c add a test case 2008-02-21 19:44:16 +00:00
arg-duplicate.c reject 'typedef int y; int test(x, y)'. 2008-04-06 06:47:48 +00:00
arg-scope-c99.c Add support for C++ default arguments, and rework Parse-Sema 2008-04-08 04:40:51 +00:00
arg-scope.c Add support for C++ default arguments, and rework Parse-Sema 2008-04-08 04:40:51 +00:00
argument-checking.m Fix PR1992 by computing the right type for string literals, which 2008-02-11 00:02:17 +00:00
array-constraint.c Change diagnostic per suggestion, to make it a bit clearer what is 2008-05-27 02:01:50 +00:00
array-declared-as-incorrect-type.c Add better validation for array types when merging decls. Patch 2007-11-06 04:28:31 +00:00
array-init.c Count the number of initializable members correctly in structs/unions 2008-05-25 14:03:31 +00:00
asm.c Check that the clobber registers are valid. 2007-11-25 00:25:21 +00:00
assign-null.c Move the null pointer constant check from Sema::CheckSingleInitializer/ActOnCallExpr/CheckMessageArgumentTypes/ActOnReturnStmt to Sema::CheckSingleAssignmentConstraints. This makes sure all null pointer assignments are considered compatible. 2007-11-27 17:58:44 +00:00
assign.c Fix <rdar://problem/5733511> clang doesn't emit error for const array. 2008-02-09 16:59:44 +00:00
ast-print.c Fix a bug handling typedefs of functions, patch by Nuno Lopes! 2007-12-06 17:20:20 +00:00
attr-deprecated.c rename some attr tests for consistency. 2008-06-26 06:32:02 +00:00
attr-mode.c Make ProcessDeclAttributes walk the declarator structure pulling 2008-06-29 00:16:31 +00:00
bitfield-layout.c Cleanup/refactoring of Sema struct layout. This patch unifies the struct 2008-05-30 09:31:38 +00:00
bogus-gcc-protocol-extension.m Support "<p>" as a short-hand for "id<p>". Here's a comment from GCC (the only documentation I could find on it). 2008-06-05 00:02:44 +00:00
builtin-stackaddress.c Fix typo in test. 2008-05-20 08:27:04 +00:00
builtins.c Fix this test on non-X86 platforms. 2008-05-25 04:43:38 +00:00
c89-2.c -C mode doesn't return comments on "#" lines, so the diag checker doesn't pick them up. 2007-08-30 06:38:49 +00:00
c89.c typedef void T; 2008-04-10 02:26:16 +00:00
callingconv.c Add new test 2008-03-07 20:04:49 +00:00
carbon.c Rename stats to print-stats to avoid conflicting with llvm's 2007-12-30 01:38:50 +00:00
cast.c casting to void is ok for structs (C99 6.5.4p2), this fixes 2007-10-29 04:26:44 +00:00
category-1.m Fix trivial crasher and downgrade an error to warning (to match GCC). 2008-06-05 04:33:44 +00:00
check-dup-decl-methods-1.m Patch to check for duplicate method decls in protocols. 2007-10-12 23:43:31 +00:00
check-dup-objc-decls-1.m Change ObjCInterfaceDecl to inherit from NamedDecl (not TypeDecl). While ObjCInterfaceDecl is arguably a TypeDecl, it isn't a ScopedDecl. Since TypeDecl's are scoped, it makes sense to simply treat them as NamedDecl's. I could have fiddled a bit more with the hierarchy (in terms of creating a non-scoped TypeDecl), however this probably isn't worth the effort. 2008-04-02 18:30:49 +00:00
check-increment.c Make sure Sema::CheckIncrementDecrementOperand() removes typedefs when doing it's analysis. 2007-11-11 14:15:57 +00:00
class-conforming-protocol-1.m Patch to create protocol conforming class types. 2007-10-11 00:55:41 +00:00
class-def-test-1.m - Tweak several tests to be compatible with my last commit. 2007-12-11 03:34:41 +00:00
class-impl-1.m Fixed all my recent test cases to have the RUN command and 2007-10-04 00:22:33 +00:00
class-names.cpp Introduce support for finding class and enum names via ordinary name lookup in C++ 2008-04-13 21:07:44 +00:00
class-proto-1.m - Tweak several tests to be compatible with my last commit. 2007-12-11 03:34:41 +00:00
cocoa.m Rename stats to print-stats to avoid conflicting with llvm's 2007-12-30 01:38:50 +00:00
compare.c Be a bit stricter about array type compatibility. 2008-02-06 04:53:22 +00:00
compatible-protocol-qualified-types.m Tweak Sema::ObjCQualifiedIdTypesAreCompatible() to handle qualified interface types on the RHS. 2008-06-01 02:43:50 +00:00
complex-int.c Finish up handling all permutations of "complex int" (in Sema::UsualArithmeticConversions()). 2008-01-15 22:21:49 +00:00
compound-literal.c Be a bit more defensive in SemaInit. 2008-05-20 05:25:56 +00:00
conditional-expr.c Fix <rdar://problem/5928590> clang -fsyntax-only: "incompatible operand types ('int' and 'void')" on input that 'gcc -fsyntax-only' eats 2008-05-12 21:44:38 +00:00
conditional-expr.m Add some more test cases that demonstrate clang is a bit stricter than GCC. These can be fixed lazily if they become a problem. 2008-05-31 23:10:15 +00:00
conditional.c fix type of ?: operator. If one of the operator is void, the type should be void as well. 2008-06-04 19:14:12 +00:00
conflicting-ivar-test-1.m Fixed test to match the new diagnostic text. 2007-12-13 00:16:34 +00:00
const-id.m Fix <rdar://problem/5965704> clang: bad receiver type 'id const' 2008-05-31 02:19:15 +00:00
cxx-namespace.cpp -Implement proper name lookup for namespaces. 2008-05-09 23:39:43 +00:00
cxx-references.cpp Fix for testcase that assigns a dereferenced reference to a pointer. The 2007-12-03 07:33:35 +00:00
darwin-align-cast.c Put back my temporary hack until Eli addresses this in a more complete fashion. 2008-06-03 22:06:04 +00:00
decl-invalid.c This patch adds very basic support for parsing and type-checking class 2008-04-13 21:30:24 +00:00
declspec.c improve error to be something end users will actually understand :) 2008-04-02 17:15:17 +00:00
default.c rename -parse-ast-print to -ast-print 2007-10-11 00:18:28 +00:00
default1.c Add support for C++ default arguments, and rework Parse-Sema 2008-04-08 04:40:51 +00:00
default1.cpp Add support for C++ default arguments, and rework Parse-Sema 2008-04-08 04:40:51 +00:00
default2.cpp Diagnose attempts to use C++ default arguments outside of a function declaration 2008-05-07 04:49:29 +00:00
deref.c Tweak fix for http://llvm.org/bugs/show_bug.cgi?id=2000 to work across typedefs. 2008-02-18 15:14:59 +00:00
enhanced-proto-2.m For @optional unimplemented methods do not issue the warning. 2007-12-11 19:10:26 +00:00
enum.c Sema::FinalizeDeclaratorGroup()...make sure we emit an diagnostic for tentative definitions with incomplete types. Touch up all test cases that are effected. 2008-01-18 00:39:39 +00:00
expr-address-of.c Fix http://llvm.org/bugs/show_bug.cgi?id=2103. 2008-02-29 23:30:25 +00:00
exprs.c Implement support for __extension__ which silences extwarnings in its 2008-02-02 20:20:10 +00:00
floating-point-compare.c Fixed test case to not expect a warning when one should not be emitted. 2007-11-29 01:03:21 +00:00
for.c rename -parse-ast-print to -ast-print 2007-10-11 00:18:28 +00:00
format-attribute.c Add attribute "format" support for typedefs of function pointers. 2008-05-09 17:36:24 +00:00
format-strings-objc.m Add test case for NSString format-string checking. 2008-06-16 18:01:05 +00:00
format-strings.c Modified format-string checking to not emit a warning when all of the 2007-12-17 19:03:13 +00:00
forward-class-1.m Fixed all my recent test cases to have the RUN command and 2007-10-04 00:22:33 +00:00
function-ptr.c give better diagnostics for converting between function pointer and void*. 2008-01-03 22:56:36 +00:00
function.c Fix handling of implicit int, resolving PR2012 and reverting (and 2008-04-05 06:32:51 +00:00
gcc-cast-ext.m Change Expr::isIntegerConstantExpr() to allow for pointer types (for GCC compatibility). Note FIXME. 2008-06-03 17:15:29 +00:00
i-c-e1.c new testcase 2007-06-08 17:58:14 +00:00
i-c-e2.c Fix PR1992 by computing the right type for string literals, which 2008-02-11 00:02:17 +00:00
id_builtin.m rename test file for builtin "id"... 2007-10-17 18:39:04 +00:00
if-empty-body.c improve error recovery handling broken 'then' or 'else' stmts in 2007-10-29 05:08:52 +00:00
illegal-types.c Make sure Sema::GetTypeForDeclarator() deals with abstract declarators when diagnosing incorrect code. 2008-01-14 23:33:18 +00:00
implicit-cast.c Fix a bug in Sema::CheckConditionalOperands(). When mixing pointers and null pointer constants, we need to promote the null pointer constant (which is an integer) to the pointer type. Test case is self explanatory. 2007-10-18 05:13:08 +00:00
implicit-decl.c Add explicit support for diagnosing implicit function decls. 2008-04-04 14:32:09 +00:00
implicit-def.c rename -parse-ast-print to -ast-print 2007-10-11 00:18:28 +00:00
implicit-int.c Unspecified type specs default to int. This fixes a crash 2007-07-13 21:02:29 +00:00
incompatible-protocol-qualified-types.m Merge all the 'assignment' diagnostic code into one routine, decloning 2008-01-04 18:04:52 +00:00
incomplete-decl.c Sema::FinalizeDeclaratorGroup(): Tighten up the tentative definition rule when dealing with arrays. 2008-01-18 20:40:52 +00:00
inherit.cpp This patch adds very basic support for parsing and type-checking class 2008-04-13 21:30:24 +00:00
init-struct-qualified.c For struct initialization, check compatibility with the unqualified 2008-06-09 03:52:40 +00:00
init.c Make sure to allow assigning a pointer to a bool. 2008-05-30 18:07:22 +00:00
int-arith-convert.c Fix for PR2501; this patch makes usual arithmetic conversions for 2008-06-28 06:23:08 +00:00
invalid-decl.c add run lines. 2007-12-12 06:22:14 +00:00
invalid-objc-decls-1.m fix expected errors. 2007-12-12 01:15:04 +00:00
invalid-struct-init.c Tweak test... 2008-02-11 02:16:41 +00:00
ivar-sem-check-1.m Fixed all my recent test cases to have the RUN command and 2007-10-04 00:22:33 +00:00
member-reference.c Sema::ActOnMemberReferenceExpr() needs to perform the default conversions. 2007-12-16 21:42:28 +00:00
merge-decls.c Sema::MergeFunctionDecl()...make sure diagnostic is accurate (wrt function declarations/definitions). Patch by Carl Lewis! 2008-01-16 15:01:34 +00:00
message.m Improve how we find private method decls. This involved: 2007-12-18 01:30:32 +00:00
method-def-1.m add run lines. 2007-12-12 06:22:14 +00:00
method-def-2.m pretty priting for method definitions. 2007-11-10 20:59:13 +00:00
method-encoding-2.m Insert invisble arguments to method definition header. 2007-11-09 17:18:29 +00:00
method-lookup.m Sema::ActOnClassMessage() needs to look through it's local implementation for private class methods. 2008-06-04 14:43:54 +00:00
method-not-defined.m Predefine all the ObjC goodies from <objc/objc.h>. Removed all the ObjC goodies from the respective test files. Moving forward, it will be very nice to assume these builtin! 2007-10-17 17:53:50 +00:00
method-undef-category-warn-1.m A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete 2008-02-08 22:06:17 +00:00
method-undefined-warn-1.m A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete 2008-02-08 22:06:17 +00:00
missing-method-context.m Fix http://llvm.org/bugs/show_bug.cgi?id=2106. 2008-02-29 21:48:07 +00:00
ms-fuzzy-asm.c Use getLogicalLineNumber() in FuzzyParseMicrosoftAsmStatement(), it's more general and simplifies the code. 2008-02-08 18:01:27 +00:00
objc-at-defs.m add parser and sema support for the funny ObjC '@defs' thing. 2008-06-21 19:39:06 +00:00
objc-bad-receiver-1.m make some diagnostics more terse, update testcases. 2008-02-01 06:57:39 +00:00
objc-comptypes-1.m Remove dependency on objc.h 2008-01-09 00:33:05 +00:00
objc-comptypes-2.m Remove dependency on objc.h 2008-01-09 00:33:05 +00:00
objc-comptypes-3.m Remove dependency on objc.h 2008-01-09 00:33:05 +00:00
objc-comptypes-4.m Patch to compare to objective-c static types where one or the other 2007-12-21 17:34:43 +00:00
objc-comptypes-5.m merge compatibility testing of qualified/unqualified interfaces together 2008-04-07 06:38:24 +00:00
objc-comptypes-6.m Remove dependency on objc.h 2008-01-09 00:33:05 +00:00
objc-comptypes-7.m Allow implicit pointer/int conversions on ObjCQualifiedIdTypes in Sema::CheckCompareOperands() and Sema::CheckAssignmentConstraints(). 2008-06-03 14:04:54 +00:00
objc-comptypes-8.m Fixed a bug reported by Chris, involving assiging 0 to a qualified object type. 2008-01-03 18:46:52 +00:00
objc-comptypes-9.m Added fixmes. 2008-06-04 20:48:08 +00:00
objc-interface-layout.m Add ObjCInterface layout support. 2008-06-04 21:54:36 +00:00
objc-ivar-lookup.m rename Decl::CompatibleAlias -> ObjCCompatibleAlias. 2008-03-31 00:36:02 +00:00
objc-legacy-implementation-1.m Fixed all my recent test cases to have the RUN command and 2007-10-04 00:22:33 +00:00
objc-method-lookup.m Fix <rdar://problem/5986833> clang on xcode: incompatible type returning 'void', expected 'int'. 2008-06-05 14:49:39 +00:00
objc-property-1.m More semantics checks of properties. Property implementation can implicitly use 2008-04-21 21:57:36 +00:00
objc-property-2.m Allow property in base class to be implemented in a 2008-04-21 23:57:08 +00:00
objc-property-3.m Test was accidently nullified in previous check-in. 2008-05-06 18:14:26 +00:00
objc-property-4.m This patch is about merging ObjC2's properties declared in class 2008-05-02 19:17:30 +00:00
objc-property-5.m Another test case for properties in protocols. 2008-05-02 21:09:40 +00:00
objc-property-6.m Teach Expr::isLvalue() about ObjC properties. For now, all properties are writable. Added a FIXME for another day. 2008-05-30 23:23:16 +00:00
objc-property-7.m Fix <rdar://problem/5979875> clang on xcode: error: use of undeclared identifier 'super' 2008-06-02 23:03:37 +00:00
objc-property-8.m "this patch adds code generation hooks for Objective-C constant strings. It also modifies Sema so that Objective-C constant strings are treated as untyped objects if the interface for the constant string class can not be found. This is consistent with Apple GCC. I thought it was consistent with GNU GCC, since this was causing failures when trying to compile GNUstep with (GNU) GCC, but it appears that this is not the case when attempting to produce a simple test case to demonstrate it. Possibly there is a way of making the error go away, but I haven't found out what it is yet." 2008-06-21 21:44:18 +00:00
objc-props-on-prots.m Fix <rdar://problem/5987482> clang on xcode: null dereference in Sema::ActOnMemberReferenceExpr. 2008-06-05 13:55:23 +00:00
objc-string.m "This moves built-in Objective-C types up the scope chains to where they can be replaced by versions included from the runtime library's headers." 2008-06-21 20:20:39 +00:00
objc-synchronized.m Parser::ParseObjCSynchronizedStmt() needs to Enter/Exit a decl scope. 2008-06-04 20:36:13 +00:00
objc-try-catch.m Fix parser bug/FIXME with @catch. 2008-06-03 05:36:54 +00:00
objc-typedef-class.m Second half of "fix" for <rdar://problem/5986085> clang on xcode: error: redefinition of 'XCElementToggler' as different kind of symbol 2008-06-05 22:57:10 +00:00
objc-types-compatible.m Update a test and add a FIXME. 2008-06-04 21:38:52 +00:00
objc-unused.m objc messages have side effects, return true from hasLocalSideEffect, 2007-09-26 22:06:30 +00:00
offsetof.c make this pass by adding an expected error, add some tests. 2008-01-30 06:46:30 +00:00
pointer-addition.c Add proper type-checking for pointer additiion; before, we were accepting 2008-05-18 18:08:51 +00:00
predef.c Tighten up handling of __func__ and friends: it should be an array 2008-01-12 18:39:25 +00:00
predefined-function.c Fix PR2042. One remaining issue: we don't currently diagnose 2008-02-17 19:31:09 +00:00
protocol-expr-1.m Patch to implement "Protocol" as a built-in type declared as 2007-12-07 00:18:54 +00:00
protocol-expr-neg-1.m Patch to implement "Protocol" as a built-in type declared as 2007-12-07 00:18:54 +00:00
protocol-id-test-1.m Patch to implemented objective-c's dynamic object pointer qualified with 2007-12-17 21:03:50 +00:00
protocol-id-test-2.m Patch to implemented objective-c's dynamic object pointer qualified with 2007-12-17 21:03:50 +00:00
protocol-id-test-3.m Merge all the 'assignment' diagnostic code into one routine, decloning 2008-01-04 18:04:52 +00:00
protocol-test-1.m Fixed all my recent test cases to have the RUN command and 2007-10-04 00:22:33 +00:00
protocol-test-2.m - Tweak several tests to be compatible with my last commit. 2007-12-11 03:34:41 +00:00
recover-goto.c Fix a bug recovering from broken code with a goto that Eli reported. 2008-01-25 00:01:10 +00:00
redefinition.c Clean up handling of function redeclarations 2008-04-21 02:02:58 +00:00
return-stack-addr.cpp Fix a bogus test 2008-01-31 06:06:29 +00:00
selector-1.m Predefine all the ObjC goodies from <objc/objc.h>. Removed all the ObjC goodies from the respective test files. Moving forward, it will be very nice to assume these builtin! 2007-10-17 17:53:50 +00:00
selector-overload.m Predefine all the ObjC goodies from <objc/objc.h>. Removed all the ObjC goodies from the respective test files. Moving forward, it will be very nice to assume these builtin! 2007-10-17 17:53:50 +00:00
self-comparison.c Added to test case for "self-comparison check" uses of relation operators: x < x and x > x 2007-10-29 17:02:56 +00:00
shift.c Don't do integer promotions of LHS for compound shift assignment. The LHS has to be a modifiable lvalue. 2007-12-13 07:28:16 +00:00
static-init.c Allow a pointer implicitly cast to a bool as a constant expression, as 2008-05-30 18:14:48 +00:00
static-ivar-ref-1.m Patch to do statically typed ivar references. 2007-11-12 22:29:28 +00:00
stmt_exprs.c Added missing "RUN:" to comment for test case file. This fixed a bug where the test 2007-11-28 19:05:11 +00:00
struct-compat.c Nevermind, these tests work... I messed up my testing. 2008-02-15 06:29:53 +00:00
struct-packed-align.c Cleanup/refactoring of Sema struct layout. This patch unifies the struct 2008-05-30 09:31:38 +00:00
switch-duplicate-defaults.c rename -parse-ast-print to -ast-print 2007-10-11 00:18:28 +00:00
switch.c rename -parse-ast-print to -ast-print 2007-10-11 00:18:28 +00:00
tentative-decls.c Fix <rdar://problem/5924576> clang -fsyntax-only generates "redefinition" errors when parsing AppKit that gcc does not. 2008-05-12 22:36:43 +00:00
typecheck-binop.c Both operands to && have to be scalars, not just one. 2008-05-13 20:16:47 +00:00
typedef-prototype.c implement test/Sema/typedef-prototype.c, allowing code 2007-11-14 06:34:38 +00:00
typedef-redef.c Don't crash if we can't find FileEntry info for a typedef, since one 2008-06-11 06:20:39 +00:00
typedef-retain.c Fix several bugs in array -> pointer decomposition. 2008-04-02 05:18:44 +00:00
typedef-variable-type.c Change diagnostic per suggestion, to make it a bit clearer what is 2008-05-27 02:01:50 +00:00
undef-protocol-methods-1.m A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete 2008-02-08 22:06:17 +00:00
undef-superclass-1.m Make sure Sema::ActOnClassMessage() correctly diagnoses "super". 2008-03-28 21:37:05 +00:00
undefined-protocol-type-1.m This is the first patch toward supporting protocol conforming 2007-10-05 21:01:53 +00:00
unused-expr.c Make the unused expression warning a bit less aggressive (found in PHP 2008-05-19 21:24:43 +00:00
usual-float.c Fix a basic bug (having to do with typedefs) in Sema::UsualArithmeticConversions(). 2007-11-10 19:45:54 +00:00
va-method-1.m Elimate bogus warning when va_start is correctly used in 2008-01-21 22:59:53 +00:00
varargs.c Get rid of bogus warnings when the second argument in va_start is either an implicit cast expr or a paren expr. 2008-02-11 04:20:54 +00:00
vector-assign.c testcase for PR2263, fixed by Nate's r50903 patch. 2008-05-12 18:31:17 +00:00
vector-cast.c Report errors for invalid casts from/to vectors. 2007-11-27 05:51:55 +00:00
vector-init.c OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris. 2008-04-18 23:10:10 +00:00
vla.c Fix this test so that it's valid; the point is to test for the crash, 2008-05-21 05:37:55 +00:00
void_arg.c Patch for PR2350; the issue was tnat we were allowing (with an error) 2008-05-22 08:54:03 +00:00
wchar_size.c Get the type right for wide string literals; it's wchar_t, not char. 2008-05-27 07:57:14 +00:00