summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* [ms-cxxabi] Destroy temporary record arguments in the calleeReid Kleckner2013-06-211-0/+9
| | | | | | | | | | | | | | | | | | Itanium destroys them in the caller at the end of the full expression, but MSVC destroys them in the callee. This is further complicated by the need to emit EH-only destructor cleanups in the caller. This should help clang compile MSVC's debug iterators more correctly. There is still an outstanding issue in PR5064 of a memcpy emitted by the LLVM backend, which is not correct for C++ records. Fixes PR16226. Reviewers: rjmccall Differential Revision: http://llvm-reviews.chandlerc.com/D929 llvm-svn: 184543
* Delete dead code.Eli Friedman2013-06-211-7/+0
| | | | llvm-svn: 184520
* Delete dead code.Eli Friedman2013-06-211-4/+1
| | | | llvm-svn: 184517
* When building a module, keep *all* declared methods in the global method pool.Douglas Gregor2013-06-211-0/+4
| | | | | | | | | | | | | | | | | As an optimization, we only kept declared methods with distinct signatures in the global method pool, to keep the method lists small. Under modules, however, one could have two different methods with the same signature that occur in different (sub)modules. If only the later submodule is important, message sends to 'id' with that selector would fail because the first method (the only one that got into the method pool) was hidden. When building a module, keep *all* of the declared methods. I did a quick check of both module build time and uses of modules, and found no performance regression despite this causing us to keep more methods in the global method pool. Fixes <rdar://problem/14148896>. llvm-svn: 184504
* Add back a condition accidentially removed in r184470.Richard Trieu2013-06-201-1/+1
| | | | llvm-svn: 184496
* Don't allow __attribute__((common)) in C++. PR16330.Eli Friedman2013-06-201-0/+6
| | | | llvm-svn: 184493
* Avoid repeatedly evaluating subexpressions when checking for unsequencedRichard Smith2013-06-201-7/+37
| | | | | | | operations in the case where evaluating a subexpression fails. No functionality change, but test/Sema/many-logical-ops.c gets ~100x faster with this change. llvm-svn: 184489
* Lazily provide a __float128 dummy type in -std=gnu++11 mode.Nico Weber2013-06-203-1/+21
| | | | | | This is needed to parse libstdc++ 4.7's type_traits, see PR13530. llvm-svn: 184476
* Extend -Wnon-pod-varargs to check calls made from function pointers.Richard Trieu2013-06-202-6/+12
| | | | llvm-svn: 184470
* Clean up warning and add a test.Eli Friedman2013-06-201-2/+2
| | | | llvm-svn: 184466
* Remove dead code.Eli Friedman2013-06-201-5/+0
| | | | llvm-svn: 184453
* Improved source code fidelity for gcc mode attribute.Enea Zaffanella2013-06-201-4/+7
| | | | llvm-svn: 184417
* Temporarily revert r183462: "Implement DR7"Chandler Carruth2013-06-201-12/+5
| | | | | | This fixes PR16370, I'll add the test case in a follow-up commit. llvm-svn: 184401
* Fix one place I missed that was memcpy'ing TypeLocs in a way that messesEli Friedman2013-06-202-2/+62
| | | | | | | | | up alignment. Fixes utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp from the libc++ testsuite. llvm-svn: 184397
* Add a workaround for a libstdc++-4.2 <tr1/hashtable> bug. This header usesRichard Smith2013-06-201-3/+23
| | | | | | | | | | return false; in a function returning a pointer. 'false' was a null pointer constant in C++98 but is not in C++11. Punch a very small hole in the initialization rules in C++11 mode to allow this specific case in system headers. llvm-svn: 184395
* Remove dead code.Eli Friedman2013-06-191-10/+0
| | | | llvm-svn: 184379
* Improve diagnostic for redeclaring static member function. Fixes PR16382.Eli Friedman2013-06-191-1/+1
| | | | llvm-svn: 184378
* Delete dead code. (Array element types are always complete in C.)Eli Friedman2013-06-191-7/+0
| | | | llvm-svn: 184332
* [Windows] Fix __declspec(property) when the getter returns a refReid Kleckner2013-06-191-1/+2
| | | | | | | | This fixes an issue when parsing atlbase.h. Patch by Will Wilson! llvm-svn: 184319
* Fix pr16354.Rafael Espindola2013-06-191-1/+21
| | | | | | | | | | | We now reject things like struct ABC { static double a; }; register double ABC::a = 1.0; llvm-svn: 184300
* Silence 'set but not used' warning when building in release mode using gcc.Andy Gibbs2013-06-191-0/+1
| | | | llvm-svn: 184299
* Delete dead code.Eli Friedman2013-06-191-37/+0
| | | | llvm-svn: 184277
* Introduce a new mangling for protocol-qualified ObjC types in C++. This allowsEli Friedman2013-06-181-36/+3
| | | | | | | | | | | | to provide proper overloading, and also prevents mangling conflicts with template arguments of protocol-qualified type. This is a non-backward-compatible mangling change, but per discussion with John, the benefits outweigh this cost. Fixes <rdar://problem/14074822>. llvm-svn: 184250
* When declaring an ObjC interface decl with a @compatibility_alias alias ↵Argyrios Kyrtzidis2013-06-181-1/+36
| | | | | | | | | | | | | | | | | | name, change the class name to the "real" one. If we have something like @class NewImage; @compatibility_alias OldImage NewImage; @class OldImage; the lookup for 'OldImage' will return the 'NewImage' decl ("@class NewImage"). In such a case, when creating the decl for "@class OldImage" use the real declaration name ("NewImage"), instead of the alias one ("OldImage"), otherwise we will break IdentifierResolver and redecls-chain invariants. Fixes crash of rdar://14112291. llvm-svn: 184238
* DR14, DR101, and part of DR1: fix handling of extern "C" declarations inRichard Smith2013-06-181-34/+40
| | | | | | | namespaces, by treating them just like we treat extern "C" declarations in function scope. llvm-svn: 184223
* Correctly compute the index of the first string format argument when decidingEli Friedman2013-06-181-1/+1
| | | | | | whether to emit a -Wformat-security warning. <rdar://problem/14178260>. llvm-svn: 184214
* Objective-C: Fixes a typo correction bug where aFariborz Jahanian2013-06-182-3/+5
| | | | | | | selector would be correted to identical selector name in certain corner cases. // rdar://7853549 llvm-svn: 184208
* Objective-C [qoi]: privide typo correction for selectorsFariborz Jahanian2013-06-182-15/+39
| | | | | | | | in addition of receiver having static type, but also when receiver has dynamic type (of 'id' variety) as well as when receiver is of 'Class' type vareity. // rdar://7853549 llvm-svn: 184195
* contextual conversion fix: C++98 compatibility warning.Larisse Voufo2013-06-181-2/+3
| | | | llvm-svn: 184167
* r184100 Fix -- Updated test cases for contextual conversionLarisse Voufo2013-06-181-3/+3
| | | | llvm-svn: 184165
* Delete dead code.Eli Friedman2013-06-181-36/+0
| | | | llvm-svn: 184154
* Revert "Updated test cases for contextual conversion"Rafael Espindola2013-06-171-3/+3
| | | | | | | | | This reverts commit r184100. It was faling on some bots: http://bb.pgr.jp/builders/cmake-clang-i686-mingw32/builds/1973/steps/test_clang/logs/Clang%20%3A%3A%20SemaCXX__cxx1y-contextual-conversion-tweaks.cpp llvm-svn: 184108
* Updated test cases for contextual conversionLarisse Voufo2013-06-171-3/+3
| | | | llvm-svn: 184100
* Clean up empty struct/union recognition.Serge Pavlov2013-06-171-13/+15
| | | | | | | | | Make use of getTypeSizeInChars to detect structs/unions of zero size. It allows more accurate detection of types of zero size. It however has a side effect - sequence of used types may change, that is why the test 'override-layout' was modified. llvm-svn: 184088
* Objective-C [qoi]: Provide fixit hint when message with typoFariborz Jahanian2013-06-172-5/+31
| | | | | | is sent to a receiver object. This is wip. // rdar://7853549 llvm-svn: 184086
* C++11: don't warn about the deprecated 'register' keyword if it's combined withRichard Smith2013-06-171-2/+12
| | | | | | an asm label. llvm-svn: 184069
* ArrayRef'ize Sema::CodeComplete*Dmitri Gribenko2013-06-161-76/+59
| | | | | | Patch by Robert Wilhelm. llvm-svn: 184052
* Updated the support for contextual conversion tweaks (n3323) with a ↵Larisse Voufo2013-06-151-56/+85
| | | | | | previously overlooked part: implicitly converting array sizes to size_t, rather than contextually converting them to some unique type. llvm-svn: 184048
* A quick fix to allow return type deduction on member templatesFaisal Vali2013-06-151-2/+19
| | | | | | | | | | by ensuring DiagnoseUseOfDecl is called both on the found decl and the decl being used (i.e the specialization in the case of member templates) whenever they are different. Per the exchange captured in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130610/081636.html a more comprehensive fix that allows both decls to be passed into DiagnoseUseOfDecl is (or should be) forthcoming relatively soon. llvm-svn: 184043
* PR16263: Implement current direction of core issue 1376. Binding a reference toRichard Smith2013-06-151-4/+43
| | | | | | | | | | | the result of a cast-to-reference-type lifetime-extends the object to which the reference inside the cast binds. This requires us to look for subobject adjustments on both the inside and the outside of the MaterializeTemporaryExpr when looking for a temporary to lifetime-extend (which we also need for core issue 616, and possibly 1213). llvm-svn: 184024
* Fix handling of const_cast from prvalue to rvalue reference: such a cast isRichard Smith2013-06-141-11/+46
| | | | | | | only permitted if the source object is of class type, and should materialize a temporary for the reference to bind to. llvm-svn: 184017
* Unify return type checking for functions and ObjC methods. Move all theEli Friedman2013-06-146-56/+52
| | | | | | | | random checks for ObjC object return types to SemaType.cpp. Fixes issue with ObjC method type checking reported on cfe-dev. llvm-svn: 184006
* Fix the warning for divide by zero to be a bit more robust. ;]Chandler Carruth2013-06-141-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, it only ever fired for zeros which formed null pointers. Now, hilariously, in C++98 this was almost anything. Including tricks like warning on the divisor in this code: typedef char c3[3]; size_t f(c3* ptr) { return (sizeof(ptr) / sizeof(*ptr)) / (size_t)(!(sizeof(ptr) % sizeof(*ptr))); } Why the RHS of the outer divide is a null pointer constant is a sordid tale of sorrow. Anyways, the committee fixed this for C++11 and onward as part of core isssue 903, and Richard recently implemented this fix causing the warning to go away here (and elsewhere). This patch restores the warning here and adds it for numerous other somewhat obvious gaffes: int g(int x) { return x / (int)(0.0); } The patch is essentially just using the full power of our constant folding in Clang to produce the warning, but insisting that it must fold to an *integer* which is zero so that we don't get false positives anywhere. llvm-svn: 183970
* Followup to r183931 to fix the lambda conversion-to-block-pointer member.Eli Friedman2013-06-131-1/+1
| | | | llvm-svn: 183942
* Fix a small bug in the linkage computation for the lambda ↵Eli Friedman2013-06-131-1/+1
| | | | | | conversion-to-function-pointer member. llvm-svn: 183931
* Allow clang to build __clear_cache on ARM.Rafael Espindola2013-06-131-1/+2
| | | | | | | | | __clear_cache is special. It needs no signature, but is a real function in compiler_rt or libgcc. Patch by Andrew Turner. llvm-svn: 183926
* C++11: If a class has a user-declared copy operation or destructor, theRichard Smith2013-06-131-1/+67
| | | | | | | | implicit definition of a copy operation is deprecated. Add a warning for this to -Wdeprecated. This warning is disabled by default for now, pending investigation into how common this situation is. llvm-svn: 183884
* In C++11, promote access declaration diagnostic from warning to error. ThereRichard Smith2013-06-131-2/+4
| | | | | | doesn't seem to be any value in even adding a -W flag for this. llvm-svn: 183882
* When copy-initializing a temporary for a reference binding, don't allow use ofRichard Smith2013-06-131-7/+5
| | | | | | explicit constructors. llvm-svn: 183879
* Include the unexpanded packs in the initializer expression when checking aNick Lewycky2013-06-131-1/+2
| | | | | | pack expanded constructor initializer list. Fixes PR16303! llvm-svn: 183878
OpenPOWER on IntegriCloud