summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Keep track of when DependentNameTypes have no associated keywordDouglas Gregor2010-04-241-1/+1
| | | | | | | (e.g., no typename, enum, class, etc.), e.g., because the context is one that is known to refer to a type. Patch from Enea Zaffanella! llvm-svn: 102243
* Add an InheritancePath parameter to the ImplicitCastExpr constructor.Anders Carlsson2010-04-231-3/+5
| | | | llvm-svn: 102218
* Require a complete type for the lhs of member pointer dereference operations ↵Sebastian Redl2010-04-231-0/+5
| | | | | | if the type isn't exactly the same as the container class. Fixes PR6783. llvm-svn: 102186
* Call PerformCopyInitialization to properly initialize the exception temporaryJohn McCall2010-04-221-15/+12
| | | | | | | | | in a throw expression. Use EmitAnyExprToMem to emit the throw expression, which magically elides the final copy-constructor call (which raises a new strict-compliance bug, but baby steps). Give __cxa_throw a destructor pointer if the exception type has a non-trivial destructor. llvm-svn: 102039
* Restore r101841 without modification. Also mark 'operator delete' as used forJohn McCall2010-04-201-0/+9
| | | | | | actual delete expressions, not just new expressions. llvm-svn: 101861
* Revert r101841 and follow-up.John McCall2010-04-201-7/+0
| | | | llvm-svn: 101859
* Don't bother looking for (or diagnosing problems with) the 'operator delete'John McCall2010-04-201-0/+7
| | | | | | associated with a new expression if -fno-exceptions is set. llvm-svn: 101841
* Keep track of the actual storage specifier written on a variable orDouglas Gregor2010-04-191-1/+3
| | | | | | | | function declaration, since it may end up being changed (e.g., "extern" can become "static" if a prior declaration was static). Patch by Enea Zaffanella and Paolo Bolzoni. llvm-svn: 101826
* Switch Sema::FindCompositePointerType() over to InitializationSequence. Douglas Gregor2010-04-161-39/+69
| | | | | | | This is the last of the uses of TryImplicitConversion outside of overload resolution and InitializationSequence itself. llvm-svn: 101569
* Move Sema::PerformImplicitConversion over to where ↵Douglas Gregor2010-04-161-24/+0
| | | | | | Sema::TryImplicitConversion is, for my own sanity. No functionality change llvm-svn: 101554
* Make Sema::BuildCXXCastArgument static, since it now only has one caller. No ↵Douglas Gregor2010-04-161-38/+40
| | | | | | functionality change llvm-svn: 101550
* Collapse the three separate initialization paths inDouglas Gregor2010-04-161-12/+1
| | | | | | | | | | | | | | | | | | TryStaticImplicitCast (for references, class types, and everything else, respectively) into a single invocation of InitializationSequence. One of the paths (for class types) was the only client of Sema::TryInitializationByConstructor, which I have eliminated. This also simplified the interface for much of the cast-checking logic, eliminating yet more code. I've kept the representation of C++ functional casts with <> 1 arguments the same, despite the fact that I hate it. That fix will come soon. To satisfy my paranoia, I've bootstrapped + tested Clang with these changes. llvm-svn: 101549
* Kill ForceRValue once and for allDouglas Gregor2010-04-161-5/+0
| | | | llvm-svn: 101502
* Eliminate the Elidable parameter to PerformImplicitConversion; weDouglas Gregor2010-04-161-23/+8
| | | | | | don't need it. llvm-svn: 101481
* Diagnose attempts to throw an abstract class type.Douglas Gregor2010-04-151-0/+5
| | | | llvm-svn: 101381
* When a member pointer is dereferenced, the class it points into must be ↵Sebastian Redl2010-04-101-0/+3
| | | | | | complete. Enforce this. llvm-svn: 100925
* Make CXXScopeSpec invalid when incomplete, and propagate that into anyJeffrey Yasskin2010-04-081-2/+2
| | | | | | | Declarator that depends on it. This fixes several redundant errors and bad recoveries. llvm-svn: 100779
* Check access for the implicit calls to destructors that occur when weJohn McCall2010-04-071-1/+5
| | | | | | | | have a temporary object in C++. Also fix a tag mismatch that Doug noticed. llvm-svn: 100593
* Minor cleanup with the ternary operatorDouglas Gregor2010-04-011-2/+2
| | | | llvm-svn: 100144
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-311-4/+4
| | | | | | the C-only "optimization". llvm-svn: 100022
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-311-4/+4
| | | | llvm-svn: 100018
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-311-4/+4
| | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
* Regularize support for naming conversion functions in using decls.John McCall2010-03-311-11/+14
| | | | llvm-svn: 99979
* Propagate the "found declaration" (i.e. the using declaration instead ofJohn McCall2010-03-301-4/+9
| | | | | | | | | | | | | 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
* the big refactoring bits of PR3782.Rafael Espindola2010-03-301-2/+4
| | | | | | | | 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
* Remove unused static functionDouglas Gregor2010-03-261-17/+0
| | | | llvm-svn: 99666
* When trying to determine whether one operand of a conditionalDouglas Gregor2010-03-261-7/+9
| | | | | | | | | expression can be converted to the type of another, only apply the lvalue-to-rvalue conversion to the type of the expression we're converting, *not* the array-to-pointer or function-to-pointer conversions. Fixes PR6595. llvm-svn: 99652
* Eliminate the non-InitializedEntity PerformCopyInitialization() andDouglas Gregor2010-03-261-3/+8
| | | | | | | | re-route its only caller to the newer PerformCopyInitialization(). We're down to one remaining caller of Sema::CheckReferenceInit. llvm-svn: 99650
* Switch semantic analysis of the conditional operator from usingDouglas Gregor2010-03-261-88/+71
| | | | | | CheckReferenceInit to using the new initialization sequence code. llvm-svn: 99647
* Kill off two more uses of Sema::CheckReferenceInit in favor of the newDouglas Gregor2010-03-251-20/+18
| | | | | | | | initialization code. Exposed a bug where we were not marking an implicit conversion as an lvalue when we were forming a call to a conversion function whose return type is a reference. llvm-svn: 99459
* Remember the "found declaration" for an overload candidate, which is theJohn McCall2010-03-191-12/+13
| | | | | | | | | | | | | | | | entity (if applicable) which was actually looked up. If a candidate was found via a using declaration, this is the UsingShadowDecl; otherwise, if the candidate is template specialization, this is the template; otherwise, this is the function. The point of this exercise is that "found declarations" are the entities we do access control for, not their underlying declarations. Broadly speaking, this patch fixes access control for using declarations. There is a *lot* of redundant code calling into the overload-resolution APIs; we really ought to clean that up. llvm-svn: 98945
* from code inspection, we were treating placement news with one argument asJohn McCall2010-03-181-7/+16
| | | | | | | | non-placement news when selecting the corresponding operator delete; this is fixed. Access and ambiguity control for calls to operator new and delete. Also AFAICT llvm-svn: 98818
* Warn about comparing an unsigned expression with 0 in tautological ways.John McCall2010-03-111-1/+1
| | | | | | Patch by mikem! llvm-svn: 98279
* Create a new InjectedClassNameType to represent bare-word references to the John McCall2010-03-101-18/+2
| | | | | | | | | | | | | injected class name of a class template or class template partial specialization. This is a non-canonical type; the canonical type is still a template specialization type. This becomes the TypeForDecl of the pattern declaration, which cleans up some amount of code (and complicates some other parts, but whatever). Fixes PR6326 and probably a few others, primarily by re-establishing a few invariants about TypeLoc sizes. llvm-svn: 98134
* Reinstate r97674 with a fix for the assertion that was firing in <list>Douglas Gregor2010-03-031-1/+1
| | | | llvm-svn: 97686
* Revert r97674; it's causing failuresDouglas Gregor2010-03-031-1/+1
| | | | llvm-svn: 97677
* Implement disambiguation of base class members via aDouglas Gregor2010-03-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | nested-name-specifier. For example, this allows member access in diamond-shaped hierarchies like: struct Base { void Foo(); int Member; }; struct D1 : public Base {}; struct D2 : public Base {}; struct Derived : public D1, public D2 { } void Test(Derived d) { d.Member = 17; // error: ambiguous cast from Derived to Base d.D1::Member = 17; // error: okay, modify D1's Base's Member } Fixes PR5820 and <rdar://problem/7535045>. Also, eliminate some redundancy between Sema::PerformObjectMemberConversion() and Sema::PerformObjectArgumentInitialization() -- the latter now calls the former. llvm-svn: 97674
* During codegen assert that any copy assignment, destructor or constructor thatRafael Espindola2010-03-021-0/+12
| | | | | | | | we need to synthesize has been marked as used by Sema. Change Sema to avoid these asserts. llvm-svn: 97589
* Warn about the deprecated string literal -> char* conversion. Fixes PR6428.Douglas Gregor2010-02-281-0/+5
| | | | llvm-svn: 97404
* Implement semantic analysis for C++ [expr.new]p18-20, which describeDouglas Gregor2010-02-261-2/+133
| | | | | | | | | | how we find the operator delete that matches withe operator new we found in a C++ new-expression. This will also need CodeGen support. On a happy note, we're now a "nans" away from building tramp3d-v4. llvm-svn: 97209
* When computing the composite pointer type for relational comparisons,Douglas Gregor2010-02-251-3/+48
| | | | | | | | | | | | | | | | | | | | | | | | equality comparisons, and conditional operators, produce a composite pointer type with the appropriate additional "const" qualifiers if the pointer types would otherwise be incompatible. This is a small extension (also present in GCC and EDG in a slightly different form) that permits code like: void** i; void const** j; i == j; with the following extwarn: t.cpp:5:5: warning: comparison of distinct pointer types ('void **' and 'void const **') uses non-standard composite pointer type 'void const *const *' [-pedantic] i == j; ~ ^ ~ Fixes PR6346, and I'll be filing a core issue about this with the C++ committee. llvm-svn: 97177
* Restore the invariant that a nested-name-specifier can only containDouglas Gregor2010-02-251-1/+1
| | | | | | | | | class types, dependent types, and namespaces. I had previously weakened this invariant while working on parsing pseudo-destructor expressions, but recent work in that area has made these changes unnecessary. llvm-svn: 97112
* Use CXXPseudoDestructorExpr as the stored representation for dependentDouglas Gregor2010-02-251-170/+54
| | | | | | | | | | | | | | | | expressions that look like pseudo-destructors, e.g., p->T::~T() where p has dependent type. At template instantiate time, we determine whether we actually have a pseudo-destructor or a member access, and funnel down to the appropriate routine in Sema. Fixes PR6380. llvm-svn: 97092
* Catch more uses of uninitialized implicit conversion sequences.John McCall2010-02-251-14/+21
| | | | | | | When diagnosing bad conversions, skip the conversion for ignored object arguments. Fixes PR 6398. llvm-svn: 97090
* Keep track of the location of the '~' in a pseudo-destructor expression.Douglas Gregor2010-02-241-2/+4
| | | | llvm-svn: 97080
* Retain complete source information for the type after the '~' in aDouglas Gregor2010-02-241-10/+9
| | | | | | | | | | | CXXPseudoDestructorExpr. Update template instantiation for pseudo-destructor expressions to use this source information and to make use of Sema::BuildPseudoDestructorExpr when the base expression is dependent or refers to a scalar type. llvm-svn: 97079
* Make sure that we have type source information for the scope type of aDouglas Gregor2010-02-241-1/+6
| | | | | | pseudo-destructor expression. Attempt #1 at fixing the MSVC buildbot. llvm-svn: 97076
* Split ActOnPseudoDestructorExpr into the part that interprets theDouglas Gregor2010-02-241-86/+149
| | | | | | | | parser's data structures and the part that performs semantic analysis and AST building, in preparation for improved template instantiation of pseudo-destructor expressions. llvm-svn: 97070
* Retain source information for the "type-name ::" in aDouglas Gregor2010-02-241-3/+6
| | | | | | | | pseudo-destructor expression such as p->T::~T() llvm-svn: 97060
* ActOnPseudoDestructorExpr now performs all semantic analysis forDouglas Gregor2010-02-241-38/+211
| | | | | | | | | | | | | | | | pseudo-destructor expressions, and builds the CXXPseudoDestructorExpr node directly. Currently, this only affects pseudo-destructor expressions when they are parsed, but not after template instantiation. That's coming next... Improve parsing of pseudo-destructor-names. When parsing the nested-name-specifier and we hit the sequence of tokens X :: ~, query the actual module to determine whether X is a type-name (in which case the X :: is part of the pseudo-destructor-name but not the nested-name-specifier) or not (in which case the X :: is part of the nested-name-specifier). llvm-svn: 97058
OpenPOWER on IntegriCloud