summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Fix for PR3663/3669: use TryToFixInvalidVariablyModifiedType for Eli Friedman2009-02-261-1/+3
| | | | | | | variable declarations where applicable. Also, a few fixes to TryToFixInvalidVariablyModifiedType for issues that this exposed. llvm-svn: 65500
* Use RecordFirst/RecordLast range checks in DeclContextDouglas Gregor2009-02-261-3/+12
| | | | llvm-svn: 65489
* Implementing parsing of template-ids as class-names, so that we canDouglas Gregor2009-02-251-0/+23
| | | | | | | | derive from a class template specialization, e.g., class B : public A<int> { }; llvm-svn: 65488
* Cope with use of the token '>>' inside a template argument list, e.g.,Douglas Gregor2009-02-252-0/+35
| | | | | | | | | | | | | vector<vector<double>> Matrix; In C++98/03, this token always means "right shift". However, if we're in a context where we know that it can't mean "right shift", provide a friendly reminder to put a space between the two >'s and then treat it as two >'s as part of recovery. In C++0x, this token is always broken into two '>' tokens. llvm-svn: 65484
* Add experimental logic in GRExprEngine::EvalEagerlyAssume() to handleTed Kremenek2009-02-251-0/+14
| | | | | | | | | | | expressions of the form: 'short x = (y != 10);' While we handle 'int x = (y != 10)' lazily, the cast to another integer type currently loses the symbolic constraint. Eager evaluation of the constraint causes the paths to bifurcate and eagerly evaluate 'y != 10' to a constant of 1 or 0. This should address <rdar://problem/6619921> until we have a better (more lazy approach) for handling promotions/truncations of symbolic integer values. llvm-svn: 65480
* Improve location information on "reused" class template specializationDouglas Gregor2009-02-251-0/+7
| | | | | | | | decls. Test and document the semantic location of class template specialization definitions that occur within a scope enclosing the scope of the class template. llvm-svn: 65478
* Perform additional semantic checking of class templateDouglas Gregor2009-02-251-11/+33
| | | | | | | | | | | | specializations. In particular: - Make sure class template specializations have a "template<>" header, and complain if they don't. - Make sure class template specializations are declared/defined within a valid context. (e.g., you can't declare a specialization std::vector<MyType> in the global namespace). llvm-svn: 65476
* Temporarily disable clearing of insert point (to indicate unreachableDaniel Dunbar2009-02-251-0/+7
| | | | | | | code) when calling noreturn functions; general expression emission isn't ready to do the right thing in all cases. llvm-svn: 65473
* Allow constant initializers to reference their defining decl.Daniel Dunbar2009-02-251-0/+11
| | | | | | - PR3662. llvm-svn: 65472
* Include the appropriate header for mallocDouglas Gregor2009-02-251-1/+2
| | | | llvm-svn: 65471
* Implement parsing of nested-name-specifiers that involve template-ids, e.g.,Douglas Gregor2009-02-257-58/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::vector<int>::allocator_type When we parse a template-id that names a type, it will become either a template-id annotation (which is a parsed representation of a template-id that has not yet been through semantic analysis) or a typename annotation (where semantic analysis has resolved the template-id to an actual type), depending on the context. We only produce a type in contexts where we know that we only need type information, e.g., in a type specifier. Otherwise, we create a template-id annotation that can later be "upgraded" by transforming it into a typename annotation when the parser needs a type. This occurs, for example, when we've parsed "std::vector<int>" above and then see the '::' after it. However, it means that when writing something like this: template<> class Outer::Inner<int> { ... }; We have two tokens to represent Outer::Inner<int>: one token for the nested name specifier Outer::, and one template-id annotation token for Inner<int>, which will be passed to semantic analysis to define the class template specialization. Most of the churn in the template tests in this patch come from an improvement in our error recovery from ill-formed template-ids. llvm-svn: 65467
* Use CheckAssignmentConstraints for checking the cleanup attr function. Fixes ↵Anders Carlsson2009-02-252-1/+11
| | | | | | PR3656. llvm-svn: 65461
* C99 DR #316 implies that the function parameter types that are knownDouglas Gregor2009-02-252-1/+15
| | | | | | | | | | only from a function definition (that does not have a prototype) are only used to determine the compatible with other declarations of that same function. In particular, when referencing the function we pretend as if it does not have a prototype. Implement this behavior, which fixes PR3626. llvm-svn: 65460
* Remove a FIXME; I was mistaken in believing gcc rejected this.Daniel Dunbar2009-02-251-1/+0
| | | | llvm-svn: 65420
* handle @encode interactions with array initializers.Chris Lattner2009-02-241-0/+6
| | | | llvm-svn: 65401
* move some initialization checking code from SemaDecl.cppChris Lattner2009-02-241-0/+1
| | | | | | to SemaInit.cpp, no functionality change. llvm-svn: 65394
* first wave of fixes for @encode sema support. This is part of PR3648.Chris Lattner2009-02-241-2/+5
| | | | | | | The big difference here is that (like string literal) @encode has array type, not pointer type. llvm-svn: 65391
* When we're declaring an object or function with linkage, teach nameDouglas Gregor2009-02-242-2/+23
| | | | | | | lookup to skip over names without linkage. This finishes <rdar://problem/6127293>. llvm-svn: 65386
* Extend the implicit declaration and checking against out-of-scopeDouglas Gregor2009-02-242-3/+33
| | | | | | | | | | | | | external declarations to also support external variable declarations. Unified the code for these two cases into two new subroutines. Note that we fail to diagnose cases like the one Neil pointed out, where a visible non-external declaration hides an external declaration by the same name. That will require some reshuffling of name lookup. llvm-svn: 65385
* Fix IRgen of constant expressions referring to external/staticDaniel Dunbar2009-02-241-0/+7
| | | | | | | variables. - PR3657. llvm-svn: 65381
* Fix PR3635 by handling ## magicallyChris Lattner2009-02-241-0/+6
| | | | llvm-svn: 65374
* In C, when we see a function declaration within a local scope, exportDouglas Gregor2009-02-241-0/+28
| | | | | | | | | | that declaration to global scope so that it can be found from other scopes. This allows us to diagnose redeclaration errors for external declarations across scopes. We also warn when name lookup finds such an out-of-scope declaration. This is part of <rdar://problem/6127293>; we'll also need to do the same thing for variables. llvm-svn: 65373
* Fix <rdar://problem/6611677>: Add basic transfer function support in the staticTed Kremenek2009-02-241-0/+10
| | | | | | | | | analyzer for array subscript expressions involving bases that are vectors. This solution is probably a hack: it gets the lvalue of the vector instead of an rvalue like all other types. This should be reviewed (big FIXME in GRExprEngine). llvm-svn: 65366
* Fix two @synchronized bugs found by inspection: the expression to sychronize ↵Daniel Dunbar2009-02-241-3/+16
| | | | | | | | | on should only be evaluated once, and it is evaluated outside the cleanup scope. Also, lift SyncEnter and SyncExit up in nervous anticipation of x86-64 zero cost EH. llvm-svn: 65362
* Improve merging of function declarations. Specifically:Douglas Gregor2009-02-245-1/+73
| | | | | | | | | | | | | | | | - When we are declaring a function in local scope, we can merge with a visible declaration from an outer scope if that declaration refers to an entity with linkage. This behavior now works in C++ and properly ignores entities without linkage. - Diagnose the use of "static" on a function declaration in local scope. - Diagnose the declaration of a static function after a non-static declaration of the same function. - Propagate the storage specifier to a function declaration from a prior declaration (PR3425) - Don't name-mangle "main" llvm-svn: 65360
* fix rdar://6611778, a redefinition of an interface was causing anChris Lattner2009-02-234-4/+15
| | | | | | | | assertion when the ivars and method list was reset into the existing interface. To fix this, mark decls as invalid when they are redefined, and don't insert ivars/methods into invalid decls. llvm-svn: 65340
* - Generate error for protocol qualifiers on 'Class'.Steve Naroff2009-02-232-3/+9
| | | | | | - Generate error for protocol qualifiers on non-ObjC types. llvm-svn: 65333
* Revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65244.Steve Naroff2009-02-232-7/+2
| | | | | | Remove support for "Class<P>". Will be making this an error. llvm-svn: 65332
* A few small improvements to Evaluate for stuff I noted in FIXMEs.Eli Friedman2009-02-231-0/+9
| | | | llvm-svn: 65305
* retain/release checker: For now don't track the retain count of NSWindow ↵Ted Kremenek2009-02-231-1/+2
| | | | | | objects (opt for false negatives). llvm-svn: 65304
* More retain/release naming convention tests.Ted Kremenek2009-02-231-0/+3
| | | | llvm-svn: 65303
* Add test case for PR 2599.Ted Kremenek2009-02-231-0/+64
| | | | llvm-svn: 65299
* Contains the following (related to problems found while investigting ↵Steve Naroff2009-02-223-5/+6
| | | | | | | | | | <rdar://problem/6497631> Message lookup is sometimes different than gcc's). - Implement instance/class overloading in ObjCContainerDecl (removing a FIXME). This involved hacking NamedDecl::declarationReplaces(), which took awhile to figure out (didn't realize replace was the default). - Changed Sema::ActOnInstanceMessage() to remove redundant warnings when dealing with protocols. For now, I've omitted the "protocol" term in the diagnostic. It simplifies the code flow and wan't always 100% accurate (e.g. "Foo<Prot>" looks in the class interface, not just the protocol). - Changed several test cases to jive with the above changes. llvm-svn: 65292
* Cleanp code with some recent suggestions.Mike Stump2009-02-221-2/+2
| | | | llvm-svn: 65285
* Fix test to be legal on 64-bit systems.Eli Friedman2009-02-221-1/+1
| | | | llvm-svn: 65270
* Throw the switch to exclusively use Evaluate (along with the small Eli Friedman2009-02-222-4/+9
| | | | | | | | | | | | | | | | helper isConstantInitializer) to check whether an initializer is constant. This passes tests, but it's possible that it'll cause regressions with real-world code. Future work: 1. The diagnostics obtained this way are lower quality at the moment; some work both here and in Evaluate is needed for accurate diagnostics. 2. We probably need some extra code when we're in -pedantic mode so we can strictly enforce the rules in C99 6.6p7. 3. Dead code cleanup (this should wait until after 2, because we might want to re-use some of the code). llvm-svn: 65265
* Fix for PR3433: map __alignof__ to preferred alignment. (This was Eli Friedman2009-02-222-5/+6
| | | | | | partially done in r65258.) llvm-svn: 65260
* Improvements to ASTContext::getDeclAlignInBytes; fixes the testcase in Eli Friedman2009-02-221-1/+10
| | | | | | | | | PR3254 and part of PR3433. The isICE changes are necessary to keep the computed results consistent with Evaluate. llvm-svn: 65258
* Match gcc and always perform array/function conversion for asm input exprs. ↵Anders Carlsson2009-02-221-0/+6
| | | | | | Fixes PR3641. llvm-svn: 65256
* Correctly encode incomplete and variable length arrays. Fixes PR3639.Anders Carlsson2009-02-221-0/+11
| | | | llvm-svn: 65255
* Sanity fix for PR3642: if we're treating a diagnostic as an error, it's Eli Friedman2009-02-221-0/+11
| | | | | | | | | | required to actually be an error for correctness. The attached testcase now gives an error instead of mysteriously crashing. Now, it's possible we actually want to support the given usage, but I haven't looked at the relevant code closely. llvm-svn: 65253
* Force arch for these test cases.Daniel Dunbar2009-02-212-2/+2
| | | | llvm-svn: 65252
* Add support for GCC ObjC extension "Class<protocol>". Sigh.Steve Naroff2009-02-211-0/+5
| | | | | | | | Found while researching <rdar://problem/6497631> Message lookup is sometimes different than gcc's. Will never be seen in user code. Needed to pass dejagnu testsuite. llvm-svn: 65244
* Warn about bogus protocol qualifiers.Steve Naroff2009-02-211-1/+6
| | | | llvm-svn: 65241
* Warn on use of __weak attribute on localFariborz Jahanian2009-02-211-0/+10
| | | | | | variable (objc2 gc specific). llvm-svn: 65240
* Fixed an ICE in meta-data generation of __weak/__strong ivars.Fariborz Jahanian2009-02-211-0/+10
| | | | llvm-svn: 65235
* Evaluation of unary deref could call integer evaluator on non-integralDaniel Dunbar2009-02-211-0/+2
| | | | | | | expr; hilarity ensued. - PR3640. llvm-svn: 65234
* Add test case to record a couple inconsistencies with GCC (found in ↵Steve Naroff2009-02-211-0/+47
| | | | | | | | <rdar://problem/6561076> [clang on Xcode] warning: cannot find protocol definition for 'OzzyP'). Removing the "cannot find protocol" warning is trivial if necessary (but I don't think it's the right thing to do). llvm-svn: 65232
* This fixes <rdar://problem/6497650> More type mismatches issues with clang.Steve Naroff2009-02-211-0/+37
| | | | | | | | | | Move two key ObjC typechecks from Sema::CheckPointerTypesForAssignment() to ASTContext::mergeTypes(). This allows us to take advantage of the recursion in ASTContext::mergeTypes(), removing some bogus warnings. This test case I've added includes an example where we still warn (and GCC doesn't). Need to talk with folks and decide what to do. At this point, the major bogosities should be fixed. llvm-svn: 65231
* Improved naming convention heuristics in the retain/release checker to betterTed Kremenek2009-02-211-0/+16
| | | | | | | | | handle method names that contain 'new', 'copy', etc., but those words might be the substring of larger words such as 'newsgroup' and 'photocopy' that do not indicate the allocation of objects. This should address the issues discussed in <rdar://problem/6552389>. llvm-svn: 65224
OpenPOWER on IntegriCloud