summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* PR13470: Ensure that copy-list-initialization isntantiates asRichard Smith2012-12-191-5/+5
| | | | | | | | | | | | copy-list-initialization (and doesn't add an additional copy step): Fill in the ListInitialization bit when creating a CXXConstructExpr. Use it when instantiating initializers in order to correctly handle instantiation of copy-list-initialization. Teach TreeTransform that function arguments are initializations, and so need this special treatment too. Finally, remove some hacks which were working around SubstInitializer's shortcomings. llvm-svn: 170489
* Change DeclContextLookup(Const)Result to (Mutable)ArrayRef<NamedDecl*>, as ↵David Blaikie2012-12-191-8/+8
| | | | | | | | | | | | | | | per review discussion in r170365 This does limit these typedefs to being sequences, but no current usage requires them to be contiguous (we could expand this to a more general iterator pair range concept at some point). Also, it'd be nice if SmallVector were constructible directly from an ArrayRef but this is a bit tricky since ArrayRef depends on SmallVectorBaseImpl for the inverse conversion. (& generalizing over all range-like things, while nice, would require some nontrivial SFINAE I haven't thought about yet) llvm-svn: 170482
* Add missing check for error return from DefaultLvalueConversion. Fixes ↵Eli Friedman2012-12-131-0/+2
| | | | | | <rdar://problem/12857416>. llvm-svn: 170056
* Properly compute triviality for explicitly-defaulted or deleted special members.Richard Smith2012-12-081-23/+28
| | | | | | | | | | | | | | Remove pre-standard restriction on explicitly-defaulted copy constructors with 'incorrect' parameter types, and instead just make those special members non-trivial as the standard requires. This required making CXXRecordDecl correctly handle classes which have both a trivial and a non-trivial special member of the same kind. This also fixes PR13217 by reimplementing DiagnoseNontrivial in terms of the new triviality computation technology. llvm-svn: 169667
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-9/+9
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Don't return a pointer to an UnresolvedSetImpl in the CXXRecordDecl interface,Argyrios Kyrtzidis2012-11-281-3/+5
| | | | | | expose only the iterators instead. llvm-svn: 168770
* PR14428: When instantiating a 'new' expression, if we had a non-dependentRichard Smith2012-11-261-20/+16
| | | | | | | | initialization, don't rebuild it. Remove a couple of hacks which were trying to work around this. Fix the special case for one-argument CXXConstructExprs to not apply if the one argument is a default argument. llvm-svn: 168582
* Do not cache a pointer to ExprEvalContexts.back().Benjamin Kramer2012-11-151-7/+9
| | | | | | | | | | It may become a dangling pointer if the underlying SmallVector reallocates. Sadly the testcase is really large and doesn't reduce well because of SmallVector's reallocation patterns. Fixes PR14336. llvm-svn: 168045
OpenPOWER on IntegriCloud