summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Driver: Add support for -fobjc-abi-version=.Daniel Dunbar2010-04-281-0/+19
| | | | | | - <rdar://problem/7919678> llvm-svn: 102559
* Ensure that cv-qualifiers are correctly removed for post-inc/decrementsAlexis Hunt2010-04-281-0/+9
| | | | | | | as well as pre- and post-inc/decrements in C (not that I think it matters for any C code). llvm-svn: 102552
* Fix template instantiation for __builtin_offfsetof expressions that refer to ↵Douglas Gregor2010-04-281-0/+16
| | | | | | members of anonymous structs/unions llvm-svn: 102551
* Diagnose __builtin_offsetof expressions that refer to bit-fieldsDouglas Gregor2010-04-282-1/+17
| | | | llvm-svn: 102548
* Support for construct/destruct of ivar arrayFariborz Jahanian2010-04-281-0/+71
| | | | | | | of c++ objects (NeXt runtime). radar 7900343. llvm-svn: 102546
* Completely reimplement __builtin_offsetof, based on a patch by RobertoDouglas Gregor2010-04-284-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amadini. This change introduces a new expression node type, OffsetOfExpr, that describes __builtin_offsetof. Previously, __builtin_offsetof was implemented using a unary operator whose subexpression involved various synthesized array-subscript and member-reference expressions, which was ugly and made it very hard to instantiate as a template. OffsetOfExpr represents the AST more faithfully, with proper type source information and a more compact representation. OffsetOfExpr also has support for dependent __builtin_offsetof expressions; it can be value-dependent, but will never be type-dependent (like sizeof or alignof). This commit introduces template instantiation for __builtin_offsetof as well. There are two major caveats to this patch: 1) CodeGen cannot handle the case where __builtin_offsetof is not a constant expression, so it produces an error. So, to avoid regressing in C, we retain the old UnaryOperator-based __builtin_offsetof implementation in C while using the shiny new OffsetOfExpr implementation in C++. The old implementation can go away once we have proper CodeGen support for this case, which we expect won't cause much trouble in C++. 2) __builtin_offsetof doesn't work well with non-POD class types, particularly when the designated field is found within a base class. I will address this in a subsequent patch. Fixes PR5880 and a bunch of assertions when building Boost.Python tests. llvm-svn: 102542
* add regex support for -verify mode. You can now do things likeChris Lattner2010-04-281-0/+14
| | | | | | | | expected-error-re {{someregex}} Patch by mike-m! llvm-svn: 102516
* Revert "Fix for PR6953: per gcc, regparm and noreturn affect the ↵Daniel Dunbar2010-04-281-9/+5
| | | | | | compatibility of", it is breaking the builds of quite a few projects (emacs, dovecot, gnutar, bison). llvm-svn: 102501
* When the qualifier of a id-expression is non-dependent but notDouglas Gregor2010-04-281-9/+8
| | | | | | | | | complete, return an error rather than falling back to building a dependent declaration reference, since we might not be in a dependent context. Fixes a fiendish crash-on-invalid in Boost.FunctionTypes that I wasn't able to reduce to anything useful. llvm-svn: 102491
* Improve name mangling for dependent template names (e.g., typenameDouglas Gregor2010-04-281-0/+17
| | | | | | | | T::template apply<U>), handling a few cases where we previously failed and performing substitutions on such dependent names. Fixes a crash in Boost.PropertyTree. llvm-svn: 102490
* When instantiating a function template specialization followingDouglas Gregor2010-04-281-0/+15
| | | | | | | | template argument deduction, use the lexical declaration context as the owner for friend function templates. Fixes 2 failures in Boost.Graph. llvm-svn: 102489
* Properly pass the address of a lazily-generated function declaration withJohn McCall2010-04-281-0/+12
| | | | | | incomplete type. Fixes PR6911. llvm-svn: 102473
* It's okay to refer to non-type template parameters anywhere they areDouglas Gregor2010-04-271-0/+9
| | | | | | visible. Fixes the remaining two failures in Boost.ScopeExit. llvm-svn: 102466
* Fix for PR6953: per gcc, regparm and noreturn affect the compatibility ofEli Friedman2010-04-271-5/+9
| | | | | | | | | function types. This could potentially have unexpected side-effects, so look here if there are new regressions. llvm-svn: 102464
* When explicitly building a temporary object (CXXTemporaryObjectExpr),Douglas Gregor2010-04-271-0/+26
| | | | | | | | | | | keep track of whether we need to zero-initialize storage prior to calling its constructor. Previously, we were only tracking this when implicitly constructing the object (a CXXConstructExpr). Fixes Boost's value-initialization tests, which means that the Boost.Config library now passes all of its tests. llvm-svn: 102461
* Diagnose the use of abstract types as array element types. Previously,Douglas Gregor2010-04-271-5/+4
| | | | | | | | | | we were relying on checking for abstract class types when an array type was actually used to declare a variable, parameter, etc. However, we need to check when the construct the array for, e.g., SFINAE purposes (see DR337). Fixes problems with Boost's is_abstract type trait. llvm-svn: 102452
* When checking the redeclaration context of a typedef that refers to aDouglas Gregor2010-04-271-0/+11
| | | | | | | tag of the same name, compare the lookup contexts rather than the actual contexts. Fixes PR6923. llvm-svn: 102437
* Don't look into incomplete types when trying to warn about unusedDouglas Gregor2010-04-271-0/+8
| | | | | | variables. Fixes PR6948. llvm-svn: 102436
* When instantiating UnresolvedLookupExpr and UnresolvedMemberExprDouglas Gregor2010-04-271-0/+25
| | | | | | | expressions, be sure to set the naming class of the LookupResult structure. Fixes PR6947. llvm-svn: 102434
* Improve the diagnostic you get when making a qualified member accessJohn McCall2010-04-272-4/+4
| | | | | | with a qualifier referencing a different type. llvm-svn: 102409
* Make the InjectedClassNameType the canonical type of the current instantiationJohn McCall2010-04-271-1/+1
| | | | | | | | | | | | | | | | of a class template or class template partial specialization. That is to say, in template <class T> class A { ... }; or template <class T> class B<const T*> { ... }; make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType when written inside the appropriate context. This allows us to track the current instantiation appropriately even inside AST routines. It also allows us to compute a DeclContext for a type much more efficiently, at some extra cost every time we write a template specialization (which can be optimized, but I've left it simple in this patch). llvm-svn: 102407
* Improve source-location information in a C++ typeid (type) expressionDouglas Gregor2010-04-262-1/+12
| | | | | | | | | | | | | | | | | by using TypeSourceInfo, cleaning up the representation somewhat. Teach getTypeOperand() to strip references and cv-qualifiers, providing the semantic view of the type without requiring any extra storage (the unmodified type remains within the TypeSourceInfo). This fixes a bug found by Boost's call_traits test. Finally, clean up semantic analysis, by splitting the ActOnCXXTypeid routine into ActOnCXXTypeId (the parser action) and two BuildCXXTypeId functions, which perform the semantic analysis for typeid(type) and typeid(expression), respectively. We now perform less work at template instantiation time (we don't look for std::type_info again) and can give better diagnostics. llvm-svn: 102393
* Diagnose declaration of reference typed ivars.Fariborz Jahanian2010-04-261-0/+5
| | | | llvm-svn: 102390
* wordsmith an objc warning, rdar://7900756Chris Lattner2010-04-261-1/+1
| | | | llvm-svn: 102388
* Introduce Type::isStructureOrClassType(), which does the obviousDouglas Gregor2010-04-261-0/+13
| | | | | | | | thing. Audit all uses of Type::isStructure(), changing those calls to isStructureOrClassType() as needed (which is alsmost everywhere). Fixes the remaining failure in Boost.Utility/Swap. llvm-svn: 102386
* Cleanup error recovery for a missing '-'|'+'Fariborz Jahanian2010-04-261-3/+1
| | | | | | on a method declaration (radar 7822196). llvm-svn: 102383
* Implement template instantiation for implicit property references inDouglas Gregor2010-04-261-0/+22
| | | | | | | Objective-C++. This is the last bit of (non-blocks-related) template instantiation logic for Objective-C++. Yay! llvm-svn: 102382
* Implement template instantiation for ObjCPropertyRefExpr.Douglas Gregor2010-04-261-11/+16
| | | | llvm-svn: 102379
* emit dtors with the right calling convention in -fno-use-cxa-atexitChris Lattner2010-04-261-0/+20
| | | | | | mode. llvm-svn: 102377
* Implement template instantiation for value-dependent Objective-C ivarDouglas Gregor2010-04-261-0/+46
| | | | | | | | references and isa expressions. Also, test template instantiation of unresolved member references to Objective-C ivar references and isa expressions. llvm-svn: 102374
* remove alignment specifier on this. CAn't this test be removed yet? :)Chris Lattner2010-04-261-1/+1
| | | | llvm-svn: 102369
* Test case for NeXt's -fno-constant-cfstrings option.Fariborz Jahanian2010-04-261-0/+33
| | | | llvm-svn: 102357
* Implement template instantiation for Objective-C @catchDouglas Gregor2010-04-261-2/+4
| | | | | | statements. This is the last of the Objective-C statements. llvm-svn: 102356
* Refactor Objective-C @catch parameter checking by detangling it fromDouglas Gregor2010-04-261-0/+4
| | | | | | | | function-parameter checking and splitting it into the normal ActOn*/Build* pair in Sema. We now use VarDecl to represent the @catch parameter rather than the ill-fitting ParmVarDecl. llvm-svn: 102347
* Ensure that we have completed a type before attempting initializationDouglas Gregor2010-04-261-0/+18
| | | | | | on that type. Fixes several problems in Boost.Interprocess. llvm-svn: 102339
* tests: Force a triple.Daniel Dunbar2010-04-261-1/+1
| | | | llvm-svn: 102332
* When name lookup finds a single declaration that was imported via aDouglas Gregor2010-04-251-0/+16
| | | | | | | | using declaration, look at its underlying declaration to determine the lookup result kind (e.g., overloaded, unresolved). Fixes at least one issue in Boost.Bimap. llvm-svn: 102317
* Improve the diagnostic when we find something we did not expect in aDouglas Gregor2010-04-251-3/+3
| | | | | | | member expression (p-> or x.), by showing the type we looked into and what we did actually find. llvm-svn: 102315
* IRgen/NeXT: Fix several alignment issues with Objective-C metadata symbols:Daniel Dunbar2010-04-251-0/+12
| | | | | | | | | - Fix some places that had the alignment hard coded. - Use ABI type alignment, not preferred type alignment -- neither of this is exactly right, as we really want the C type alignment as required by the runtime, but the ABI alignment is a more correct choice. This should be equivalent for x86_64, but fixes the alignment for ARM. llvm-svn: 102314
* tests: Convert test to FileCheck.Daniel Dunbar2010-04-251-20/+23
| | | | llvm-svn: 102313
* IRgen/NeXT: Reuse EmitImageInfo for both fragile and non-fragile ABI. This ↵Daniel Dunbar2010-04-251-2/+8
| | | | | | fixes Clang to correctly emit the "CorrectedSynthesize" bit when using the non-fragile ABI. llvm-svn: 102312
* When performing name lookup for an operator name, be sure to lookDouglas Gregor2010-04-251-0/+21
| | | | | | through using declarations. Fixes ~18 tests in Boost.Fusion. llvm-svn: 102311
* Land this test.Anders Carlsson2010-04-251-1/+16
| | | | llvm-svn: 102292
* Tweak test for destruction of copied temporary objectsDouglas Gregor2010-04-251-0/+1
| | | | llvm-svn: 102291
* When copying a temporary object to initialize an entity for which theDouglas Gregor2010-04-251-0/+18
| | | | | | | temporary needs to be bound, bind the copy object. Otherwise, we won't end up calling the destructor for the copy. Fixes Boost.Optional. llvm-svn: 102290
* Revert enough of my patches to fix self-host again :(Anders Carlsson2010-04-251-16/+1
| | | | llvm-svn: 102289
* When we create a temporary of class type that we don't immediatelyDouglas Gregor2010-04-241-0/+13
| | | | | | | bind, check accessibility of the destructor and mark the declaration as referenced. Fixes a bunch of Boost.Regex failures. llvm-svn: 102287
* DefineImplicitCopyConstructor now uses SetBaseOrMemberInitializers to create ↵Anders Carlsson2010-04-241-1/+16
| | | | | | implicit base initializers. (Member initializers are still handled by CodeGenFunction::SynthesizeCXXCopyConstructor for now). llvm-svn: 102279
* When we attempt to create a temporary object of class type, be sureDouglas Gregor2010-04-241-0/+15
| | | | | | | | | | that the type we're copying is complete. Boost.Regex now builds, although it's failing its regression tests with our favorite "Sema doesn't consider destructor as used." assertion. llvm-svn: 102271
* When we are performing copy initialization of a class type via itsDouglas Gregor2010-04-243-4/+16
| | | | | | | | | | | copy constructor, suppress user-defined conversions on the argument. Otherwise, we can end up in a recursion loop where the bind the argument of the copy constructor to another copy constructor call, whose argument is then a copy constructor call... Found by Boost.Regex which, alas, still isn't building. llvm-svn: 102269
OpenPOWER on IntegriCloud