summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix is_trivially_constructible preconditions.Eli Friedman2013-09-111-12/+12
| | | | | | | | | Fixes a crash in cases where the first argument was an incomplete type or an uninstantiated template type. <rdar://problem/14938471> llvm-svn: 190482
* AST: __uuidof should leak through templated typesDavid Majnemer2013-09-071-7/+17
| | | | | | | | | | | | | | | Summary: __uuidof on templated types should exmaine if any of its template parameters have a uuid declspec. If exactly one does, then take it. Otherwise, issue an appropriate error. Reviewers: rsmith, thakis, rnk CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1419 llvm-svn: 190240
* Properly track l-paren of a CXXFucntionalCastExpr.Eli Friedman2013-08-151-2/+3
| | | | | | | | | | In addition to storing more useful information in the AST, this fixes a semantic check in template instantiation which checks whether the l-paren location is valid. Fixes PR16903. llvm-svn: 188495
* A few small cleanups to r187504. Thanks to dblaikie for the assist.Kaelyn Uhrain2013-07-311-8/+7
| | | | llvm-svn: 187521
* Improve the diagnostic experience, including adding recovery, forKaelyn Uhrain2013-07-311-3/+34
| | | | | | changing '->' to '.' when there is no operator-> defined for a class. llvm-svn: 187504
* ObjectiveC arc: Move check for type conversions in arcFariborz Jahanian2013-07-311-1/+2
| | | | | | | | out of ImpCastExprToType and to the caller site as appropriate. This is in prep. to do more work for // rdar://14569171 llvm-svn: 187503
* Add missing check for creating an instance of an abstract class through anRichard Smith2013-07-201-1/+5
| | | | | | implicit conversion sequence. llvm-svn: 186769
* If an unimported submodule of an imported module contains a declaration of aRichard Smith2013-07-141-1/+5
| | | | | | | global allocation or deallocation function, that should not cause that global allocation or deallocation function to become unavailable. llvm-svn: 186270
* 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
* 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
* 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
* Allow paren casted throw statements inside of ternary expressionsDavid Majnemer2013-06-021-2/+2
| | | | | | | | | | | | | | clang would incorrectly not allow the following: int x = true ? (throw 1) : 2; The problem exists because we don't see beyond the parens. This, in turn, causes us to believe that we are choosing between void and int which we diagnose as an error. Instead, allow clang to see the 'throw' inside the parens. llvm-svn: 183085
* Add support to fallback on operator new when a placement operator new[] is ↵Aaron Ballman2013-05-301-0/+15
| | | | | | called for which there is no valid declaration. This fallback only happens in Microsoft compatibility mode. This patch addresses PR13164, and improves support for the WDK. llvm-svn: 182905
* PR14772: Support constant expression evaluation for _Atomic types.Richard Smith2013-05-231-6/+16
| | | | | | | | | * Treat _Atomic(T) as a literal type if T is a literal type. * Evaluate expressions of this type properly. * Fix a lurking bug where we built completely bogus ASTs for converting to _Atomic types in C++ in some cases, caught by the tests for this change. llvm-svn: 182541
* Refactor places which perform contextual implicit conversions to go through aRichard Smith2013-05-211-75/+79
| | | | | | | | | | | | | common function. The C++1y contextual implicit conversion rules themselves are not yet implemented, however. This also fixes a subtle bug where template instantiation context notes were dropped for diagnostics coming from conversions for integral constant expressions -- we were implicitly slicing a SemaDiagnosticBuilder into a DiagnosticBuilder when producing these diagnostics, and losing their context notes in the process. llvm-svn: 182406
* ArrayRef'ize Sema::FindAllocationFunctionsDmitri Gribenko2013-05-101-28/+19
| | | | | | Patch by Robert Wilhelm. llvm-svn: 181594
* ArrayRef'ize Sema::FindAllocationOverloadDmitri Gribenko2013-05-101-23/+16
| | | | | | | Now tests should pass. The previous error was caused by a misplaced backing array for MutableArrayRef that I introduced. llvm-svn: 181570
* Revert my r181563, breaks tests on buildbotsDmitri Gribenko2013-05-101-16/+23
| | | | llvm-svn: 181568
* ArrayRef'ize Sema::FindAllocationOverloadDmitri Gribenko2013-05-091-23/+16
| | | | llvm-svn: 181563
* ArrayRef'ize some SemaOverload methodsDmitri Gribenko2013-05-091-2/+3
| | | | | | Patch by Robert Wilhelm. llvm-svn: 181544
* Replace 'MultiExprArg()' with 'None'Dmitri Gribenko2013-05-051-2/+2
| | | | llvm-svn: 181166
* ArrayRef'ization of some methods in SemaOverload. Patch by Robert Wilhelm!Richard Smith2013-05-051-1/+1
| | | | llvm-svn: 181158
* Don't build a call expression referring to a function which we're not allowedRichard Smith2013-05-041-7/+14
| | | | | | | | | to use. This makes very little difference right now (other than suppressing follow-on errors in some cases), but will matter more once we support deduced return types (we don't want expressions with undeduced return types in the AST). llvm-svn: 181107
* ArrayRef'ize InitializationSequence constructor and ↵Dmitri Gribenko2013-05-031-34/+28
| | | | | | | | InitializationSequence::Diagnose() Patch by Robert Wilhelm. llvm-svn: 181022
* Move parsing of identifiers in MS-style inline assembly intoJohn McCall2013-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | the actual parser and support arbitrary id-expressions. We're actually basically set up to do arbitrary expressions here if we wanted to. Assembly operands permit things like A::x to be written regardless of language mode, which forces us to embellish the evaluation context logic somewhat. The logic here under template instantiation is incorrect; we need to preserve the fact that an expression was unevaluated. Of course, template instantiation in general is fishy here because we have no way of delaying semantic analysis in the MC parser. It's all just fishy. I've also fixed the serialization of MS asm statements. This commit depends on an LLVM commit. llvm-svn: 180976
* When deducing an 'auto' type, don't modify the type-as-written.Richard Smith2013-04-301-5/+3
| | | | llvm-svn: 180808
* Don't treat a non-deduced 'auto' type as being type-dependent. Instead, thereRichard Smith2013-04-301-3/+4
| | | | | | | | are now two distinct canonical 'AutoType's: one is the undeduced 'auto' placeholder type, and the other is a deduced-but-dependent type. All deduced-to-a-non-dependent-type cases are still non-canonical. llvm-svn: 180789
* Small CapturedStmt improvementsBen Langmuir2013-04-291-22/+17
| | | | | | | | | | | | | Add a CapturedStmt.h similar to Lambda.h to reduce the typing required to get to the CapturedRegionKind enum. This also allows codegen to access this enum without including Sema/ScopeInfo.h. Also removes some duplicated code for capturing 'this' between CapturedStmt and Lambda. Differential Revision: http://llvm-reviews.chandlerc.com/D712 llvm-svn: 180710
* Implement C++1y decltype(auto).Richard Smith2013-04-261-1/+1
| | | | llvm-svn: 180610
* C++1y constexpr extensions, round 1: Allow most forms of declaration andRichard Smith2013-04-221-1/+1
| | | | | | | | statement in constexpr functions. Everything which doesn't require variable mutation is also allowed as an extension in C++11. 'void' becomes a literal type to support constexpr functions which return 'void'. llvm-svn: 180022
* Sema for Captured StatementsTareq A. Siraj2013-04-161-0/+13
| | | | | | | | | | | | | Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic analysis. Currently captures all variables by reference. TODO: templates Author: Ben Langmuir <ben.langmuir@intel.com> Differential Revision: http://llvm-reviews.chandlerc.com/D433 llvm-svn: 179618
* Basic support for Microsoft property declarations andJohn McCall2013-04-161-0/+5
| | | | | | | | references thereto. Patch by Tong Shen! llvm-svn: 179585
* Add 178663 back.Rafael Espindola2013-04-031-3/+2
| | | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb went back green before it processed the reverted 178663, so it could not have been the culprit. Revert "Revert 178663." This reverts commit 4f8a3eb2ce5d4ba422483439e20c8cbb4d953a41. llvm-svn: 178682
* Revert 178663.Rafael Espindola2013-04-031-2/+3
| | | | | | | | | | Looks like it broke http://lab.llvm.org:8011/builders/clang-x86_64-darwin10-gdb Revert "Don't compute a patched/semantic storage class." This reverts commit 8f187f62cb0487d31bc4afdfcd47e11fe9a51d05. llvm-svn: 178681
* Don't compute a patched/semantic storage class.Rafael Espindola2013-04-031-3/+2
| | | | | | | | | | | For variables and functions clang used to store two storage classes. The one "as written" in the code and a patched one, which, for example, propagates static to the following decls. This apparently is from the days clang lacked linkage computation. It is now redundant and this patch removes it. llvm-svn: 178663
* Implement compiler intrinsics needed for compatibility with MSVC 2012 ↵Joao Matos2013-03-271-31/+76
| | | | | | | | <type_traits>. Patch by me and Ryan Molden. llvm-svn: 178111
* Implement special-case name lookup for inheriting constructors: memberRichard Smith2013-03-261-0/+37
| | | | | | | using-declarations with names which look constructor-like are interpreted as constructor names. llvm-svn: 177957
* PR7256: Provide a fixit for incorrect destructor declarationsDavid Blaikie2013-03-201-2/+10
| | | | | | Fix by Ismail Pazarbasi (ismail.pazarbasi@gmail.com), review by Dmitri Gribenko. llvm-svn: 177546
* ArrayRef-ize ASTContext::getFunctionType and Sema::BuildFunctionType.Jordan Rose2013-03-081-3/+2
| | | | | | No (intended) functionality change. llvm-svn: 176726
* Improve LLDB's implicit cast-to-id to work with C++11 auto and any ↵Douglas Gregor2013-03-071-3/+2
| | | | | | Objective-C object type <rdar://problem/13338107>. llvm-svn: 176665
* The meat of this patch is in BuildCXXMemberCalLExpr where we make it useNick Lewycky2013-02-121-3/+7
| | | | | | | | | | | | MarkMemberReferenced instead of marking functions referenced directly. An audit of callers to MarkFunctionReferenced and DiagnoseUseOfDecl also caused a few other changes: * don't mark functions odr-used when considering them for an initialization sequence. Do mark them referenced though. * the function nominated by the cleanup attribute should be diagnosed. * operator new/delete should be diagnosed when building a 'new' expression. llvm-svn: 174951
* Enable overloading of OpenCL events - this is needed for the overloaded ↵Guy Benyei2013-02-071-0/+6
| | | | | | OpenCL builtin functions. llvm-svn: 174630
* Patch to check for integer overflow. It has beenFariborz Jahanian2013-01-241-2/+3
| | | | | | commented on and approved by Richard Smith. llvm-svn: 173377
* Add -Wunsequenced (with compatibility alias -Wsequence-point) to warn onRichard Smith2013-01-171-1/+2
| | | | | | | expressions which have undefined behavior due to multiple unsequenced modifications or an unsequenced modification and use of a variable. llvm-svn: 172690
* Refactor to call ActOnFinishFullExpr on every full expression. TeachRichard Smith2013-01-141-9/+12
| | | | | | | | ActOnFinishFullExpr that some of its checks only apply to discarded-value expressions. This adds missing checks for unexpanded variadic template parameter packs to a handful of constructs. llvm-svn: 172485
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-3/+3
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-021-10/+10
| | | | llvm-svn: 171367
* ArrayRefize a CompoundStmt constructor.Nico Weber2012-12-291-1/+1
| | | | llvm-svn: 171238
OpenPOWER on IntegriCloud