summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* Revert r100193 since it causes failures in objc in clangMon P Wang2010-04-024-10/+8
| | | | llvm-svn: 100200
* Rework our handling of copy construction of temporaries, which was aDouglas Gregor2010-04-025-4/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | poor (and wrong) approximation of the actual rules governing when to build a copy and when it can be elided. The correct implementation is actually simpler than the approximation. When we only enumerate constructors as part of initialization (e.g., for direct initialization or when we're copying from a class type or one of its derived classes), we don't create a copy. When we enumerate all conversion functions, we do create a copy. Before, we created some extra copies and missed some others. The new test copy-initialization.cpp shows a case where we missed creating a (required, non-elidable) copy as part of a user-defined conversion, which resulted in a miscompile. This commit also fixes PR6757, where the missing copy made us reject well-formed code in the ternary operator. This commit also cleans up our handling of copy elision in the case where we create an extra copy of a temporary object, which became necessary now that we produce the right copies. The code that seeks to find the temporary object being copied has moved into Expr::getTemporaryObject(); it used to have two different not-quite-the-same implementations, one in Sema and one in CodeGen. Note that we still do not attempt to perform the named return value optimization, so we miss copy elisions for return values and throw expressions. llvm-svn: 100196
* Reapply patch for adding support for address spaces and added a isVolatile ↵Mon P Wang2010-04-024-8/+10
| | | | | | field to memcpy, memmove, and memset. llvm-svn: 100193
* If a constructor is a dependent context, just set the base and member ↵Anders Carlsson2010-04-021-3/+3
| | | | | | initializers as they are written. Fixes a bug where we wouldn't show initialization order warnings when instantiating. llvm-svn: 100180
* Diagnose multiple base and member initializers in class templates.Anders Carlsson2010-04-021-0/+25
| | | | llvm-svn: 100179
* Check in a motivating test for the revised access semantics.John McCall2010-04-021-0/+16
| | | | llvm-svn: 100159
* Correct the calculation of access to more closely model the wording inJohn McCall2010-04-021-0/+59
| | | | | | the standard. llvm-svn: 100155
* Relax the typesafty rules of block pointers types whichFariborz Jahanian2010-04-011-4/+4
| | | | | | take'id' or return 'id' in their type. Fixes radar 7814131. llvm-svn: 100129
* Overhaul checking of non-type template arguments that should refer toDouglas Gregor2010-04-015-16/+87
| | | | | | | | | | | an object or function. Our previous checking was too lax, and ended up allowing missing or extraneous address-of operators, among other evils. The new checking provides better diagnostics and adheres more closely to the standard. Fixes PR6563 and PR6749. llvm-svn: 100125
* Use the element type to compute the array size when the base region is a ↵Zhongxing Xu2010-04-012-1/+25
| | | | | | | | VarRegion. Patch by Jordy Rose. llvm-svn: 100099
* Fix a bug (PR 6699) in RegionStore::RemoveDeadBindings() whereTed Kremenek2010-04-011-0/+16
| | | | | | array values with a non-zero offset would get prematurely pruned from the store. llvm-svn: 100067
* Improve diagnostics when an elaborated-type-specifer containing aDouglas Gregor2010-03-314-8/+8
| | | | | | | | | | | | | | | | nested-name-specifier (e.g., "class T::foo") fails to find a tag member in the scope nominated by the nested-name-specifier. Previously, we gave a bland error: 'Nested' does not name a tag member in the specified scope which didn't actually say where we were looking, which was rather horrible when the nested-name-specifier was instantiated. Now, we give something a bit better: error: no class named 'Nested' in 'NoDepBase<T>' llvm-svn: 100060
* Change the representation of dependent elaborated-type-specifiersDouglas Gregor2010-03-312-3/+16
| | | | | | | | | | | | | | (such as "class T::foo") from an ElaboratedType of a TypenameType to a DependentNameType, which more accurately models the underlying concept. Improve template instantiation for DependentNameType nodes that represent nested-name-specifiers, by performing tag name lookup and checking the resulting tag appropriately. Fixes PR5681. There is still much testing and cleanup to do in this area. llvm-svn: 100054
* Issue better syntax error when objc's messagingFariborz Jahanian2010-03-311-0/+6
| | | | | | ares are not separated by ':' (radar 7030268). llvm-svn: 100040
* Re-bind non-dependent CXXTemporaryObjectExpr nodes as temporaries whenChandler Carruth2010-03-311-0/+13
| | | | | | | instantiating a template, which ensures the destructor is called. This fixes PR6671. llvm-svn: 100029
* Patch implements gcc's -Wno-protocol option to suppress warningFariborz Jahanian2010-03-317-15/+47
| | | | | | | on unimplemented methods in protocols adopted by a class. (radar 7056600). llvm-svn: 100028
* Support __attribute__((unused)) on types. This suddenly started firingJohn McCall2010-03-311-1/+16
| | | | | | a lot for me on selfhosts, I dunno why. llvm-svn: 99981
* Fix PR6327: restore invariants when there's a parse error in an initializer.John McCall2010-03-312-1/+20
| | | | llvm-svn: 99980
* Regularize support for naming conversion functions in using decls.John McCall2010-03-311-1/+42
| | | | llvm-svn: 99979
* Don't skip past the '}' if an expression has error and is not followed by ';'.Argyrios Kyrtzidis2010-03-312-1/+5
| | | | llvm-svn: 99972
* Drastically simplify the computation of linkage for typeinfo by usingDouglas Gregor2010-03-311-0/+1
| | | | | | | | the existing (and already well-tested) linkage computation for types, with minor tweaks for dynamic classes and (pointers to) incomplete types. Fixes PR6597. llvm-svn: 99968
* Introduce a new kind of derived-to-base cast which bypasses the need forJohn McCall2010-03-301-0/+40
| | | | | | | null checks, and make sure we elide null checks when accessing base class members. llvm-svn: 99963
* Slightly relax test case. An upcoming LLVM commit will change the xor ↵Jakob Stoklund Olesen2010-03-301-1/+1
| | | | | | instruction. llvm-svn: 99962
* Fix test in -Asserts build.Daniel Dunbar2010-03-301-1/+1
| | | | llvm-svn: 99960
* Recognize __attribute__((NSObject)) directly appliedFariborz Jahanian2010-03-301-0/+6
| | | | | | on retain properties. (radar 7809468). llvm-svn: 99951
* Revert Mon Ping's 99930 due to broken llvm-gcc buildbots.Bob Wilson2010-03-304-10/+8
| | | | llvm-svn: 99949
* Remember the regparm attribute in FunctionType::ExtInfo.Rafael Espindola2010-03-301-2/+6
| | | | | | Fixes PR3782. llvm-svn: 99940
* When "delayed parsing" C++ default arguments, if there is an error, there ↵Argyrios Kyrtzidis2010-03-301-0/+9
| | | | | | | | | | | | may be tokens left in the token stream that will interfere (they will be parsed as if they are after the class' '}') and a crash will occur because the CachedTokens that holds them will be deleted while the lexer is still using them. Make sure that the tokens of default args are removed from the token stream. Fixes PR6647. llvm-svn: 99939
* Add a test for C++ [stmt.select]p3, which specifies that redeclaring aDouglas Gregor2010-03-301-0/+11
| | | | | | | | name in the outermost block of a if/else that declares the same name is ill-formed. Turns out that Clang and MSVC were right about PR6739; GCC is too lax. llvm-svn: 99937
* Propagate the "found declaration" (i.e. the using declaration instead ofJohn McCall2010-03-301-0/+18
| | | | | | | | | | | | | the underlying/instantiated decl) through a lot of API, including "intermediate" MemberExprs required for (e.g.) template instantiation. This is necessary because of the access semantics of member accesses to using declarations: only the base class *containing the using decl* need be accessible from the naming class. This allows us to complete an access-controlled selfhost, if there are no recent regressions. llvm-svn: 99936
* Fix this test on windows. When running on windows we printRafael Espindola2010-03-301-1/+1
| | | | | | | | double 0.000000e+000 instead of double 0.000000e+00 llvm-svn: 99932
* Added support for address spaces and added a isVolatile field to memcpy, ↵Mon P Wang2010-03-304-8/+10
| | | | | | memmove, and memset llvm-svn: 99930
* Improve diagnostics when printing a template instantiation backtraceDouglas Gregor2010-03-301-1/+1
| | | | | | | | | | involving substitution of deduced template arguments into a class template partial specialization or function template, or when substituting explicitly-specific template arguments into a function template. We now print the actual deduced argument bindings so the user can see what got deduced. llvm-svn: 99923
* RegionStore: specially handle loads from integer global variables declared ↵Ted Kremenek2010-03-301-0/+35
| | | | | | | | 'const'. Fixes a false positive reported in PR 6288. llvm-svn: 99922
* the big refactoring bits of PR3782.Rafael Espindola2010-03-301-1/+2
| | | | | | | | This introduces FunctionType::ExtInfo to hold the calling convention and the noreturn attribute. The next patch will extend it to include the regparm attribute and fix the bug. llvm-svn: 99920
* Change the analyzer to recognize (but ignore) assignments to isa. Fixes PR ↵Ted Kremenek2010-03-301-0/+10
| | | | | | 6302. llvm-svn: 99904
* Add Support for 'warn_unused_result" attribute onFariborz Jahanian2010-03-301-2/+10
| | | | | | objective-c methods. (radar 7418262). llvm-svn: 99903
* Don't produce a vtable if we are just instantiating a method and theRafael Espindola2010-03-301-0/+14
| | | | | | | | class has no key function. Fix PR6738. llvm-svn: 99900
* Fix a bug where we would incorrectly report an error about initializing two ↵Anders Carlsson2010-03-301-6/+15
| | | | | | fields in an anonymous struct. llvm-svn: 99891
* Use the new function in EmitClassAggrMemberwiseCopy, fixing the same assert ↵Anders Carlsson2010-03-301-0/+1
| | | | | | as seen in PR6628 but for arrays this time. llvm-svn: 99867
* Handle default arguments when calling copy constructors for bases or members ↵Anders Carlsson2010-03-301-0/+43
| | | | | | when synthesizing a copy constructor. Fixes PR6628. llvm-svn: 99864
* Change a test to FileCheck bitcode instead of assembler.Anders Carlsson2010-03-301-12/+2
| | | | llvm-svn: 99863
* Flip the switch and use the new vtable layout code for everything. I've ↵Anders Carlsson2010-03-301-10/+10
| | | | | | verified that this passes a self-host but I'll let the bots self host as well before removing the now dead code. llvm-svn: 99861
* When collecting virtual bases it's very important to use the canonical type ↵Anders Carlsson2010-03-291-0/+23
| | | | | | of the base class. Otherwise, we might add the same virtual base class twice if the virtual base is an instantiated template. Fixes PR6251. llvm-svn: 99829
* add support for -MQ flag to quote targets in dependency file,Chris Lattner2010-03-291-0/+26
| | | | | | PR6661, patch by Ori Avtalion! llvm-svn: 99821
* Another vtable layout fix, making us match gcc better.Anders Carlsson2010-03-291-0/+30
| | | | llvm-svn: 99812
* Support __attribute__((packed)) (along with other attributes) at theDouglas Gregor2010-03-292-0/+15
| | | | | | end of a struct/class/union in C++, from Justin Bogner! llvm-svn: 99811
* Fix a nasty bug in the virtual base computation which would lead to us ↵Anders Carlsson2010-03-291-0/+12
| | | | | | initializing virtual bases in the wrong order. llvm-svn: 99806
* After performing template argument deduction for a function template,Douglas Gregor2010-03-282-0/+40
| | | | | | | | | | | | | | | | | | | | check deduced non-type template arguments and template template arguments against the template parameters for which they were deduced, performing conversions as appropriate so that deduced template arguments get the same treatment as explicitly-specified template arguments. This is the bulk of PR6723. Also keep track of whether deduction of a non-type template argument came from an array bound (vs. anywhere else). With this information, we enforce C++ [temp.deduct.type]p17, which requires exact type matches when deduction deduces a non-type template argument from something that is not an array bound. Finally, when in a SFINAE context, translate the "zero sized arrays are an extension" extension diagnostic into a hard error (for better standard conformance), which was a minor part of PR6723. llvm-svn: 99734
* Further improvement to point to categoryFariborz Jahanian2010-03-271-3/+3
| | | | | | whose protocolls methods needs implementation. llvm-svn: 99730
OpenPOWER on IntegriCloud