summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Always make sure we're using an unqualified type when building aDouglas Gregor2009-11-081-2/+2
| | | | | | constructor name. Fixes PR5418. llvm-svn: 86441
* Make sure isCopyAssignment is only true for actual copy assignment operators,Eli Friedman2009-11-071-1/+0
| | | | | | | | instead of all assignment operators. The mistake messes up IRGen because it ends up assuming that the assignment operator is actually the implicit copy assignment operator, and therefore tries to emit the RHS as an lvalue. llvm-svn: 86307
* This patch implements Sema for clause 13.3.3.1p4.Fariborz Jahanian2009-11-061-0/+1
| | | | | | | It has to do with vararg constructors used as conversion functions. Code gen needs work. This is WIP. llvm-svn: 86207
* Fixed two places where we needed to force completion of a typeDouglas Gregor2009-11-051-7/+10
| | | | | | | | | | | | (without complaining if it fails) to get proper semantics: reference binding with a derived-to-base conversion and the enumeration of constructors for user-defined conversions. There are probably more cases to fix, but my prior attempt at statically ensuring that complete-type checking always happens failed. Perhaps I'll try again. With this change, Clang can parse include/llvm/*.h! llvm-svn: 86129
* Comments, formatting. Based on patch by Brandon Pearcy!John McCall2009-11-041-2/+8
| | | | llvm-svn: 86065
* Diagnose using a field to initialize itself. Patch by Brandon Pearcy!John McCall2009-11-041-0/+59
| | | | llvm-svn: 86061
* Don't try to check the initialization of fields with dependentDouglas Gregor2009-11-041-7/+16
| | | | | | | | types. Fixes PR5352. Fariborz, please review. llvm-svn: 86031
* Switch parsing of using declarations over to ParseUnqualifiedId.Douglas Gregor2009-11-041-12/+27
| | | | llvm-svn: 86027
* Introduce a new class, UnqualifiedId, that provides a parsedDouglas Gregor2009-11-031-7/+7
| | | | | | | | | | | | | | | | representation of a C++ unqualified-id, along with a single parsing function (Parser::ParseUnqualifiedId) that will parse all of the various forms of unqualified-id in C++. Replace the representation of the declarator name in Declarator with the new UnqualifiedId class, simplifying declarator-id parsing considerably and providing more source-location information to Sema. In the future, I hope to migrate all of the other unqualified-id-parsing code over to this single representation, then begin to merge actions that are currently only different because we didn't have a unqualified notion of the name in the parser. llvm-svn: 85851
* Make sure to call CompleteConstructorCall for bases and members that are ↵Anders Carlsson2009-10-291-28/+53
| | | | | | initialized implicitly in constructors so that default arguments etc are set correctly. Fixes PR5283. llvm-svn: 85510
* Use array's base element type in getting to itsFariborz Jahanian2009-10-281-1/+1
| | | | | | constructor. WIP. llvm-svn: 85420
* Removed an unnecessary arguement passed to InitializeVarWithConstructorFariborz Jahanian2009-10-281-3/+2
| | | | | | | which should come from the variable and wasn't correct for arrays in any case. No change in functionality. llvm-svn: 85415
* remove a nonsensical todoChris Lattner2009-10-251-1/+0
| | | | llvm-svn: 85067
* change Sema::ActOnFriendTypeDecl to use GetTypeForDeclarator instead Chris Lattner2009-10-251-5/+6
| | | | | | | | | of ConvertDeclSpecToType, which I'd like to keep private to SemaType.cpp. We do this by cons'ing up a trivial Declarator for the type. John, please review. llvm-svn: 85060
* Audit the code for places where it is assumed that every base specifier ↵Sebastian Redl2009-10-251-0/+2
| | | | | | refers to a RecordType. Add assertions or conditions as appropriate. This fixes another crash in the Apache stdlib vector. llvm-svn: 85055
* When building types from declarators, instead of building two types (one forJohn McCall2009-10-221-2/+1
| | | | | | | | | | | | | | | | | | | | | the DeclaratorInfo, one for semantic analysis), just build a single type whose canonical type will reflect the semantic analysis (assuming the type is well-formed, of course). To make that work, make a few changes to the type system: * allow the nominal pointee type of a reference type to be a (possibly sugared) reference type. Also, preserve the original spelling of the reference type. Both of these can be ignored on canonical reference types. * Remove ObjCProtocolListType and preserve the associated source information on the various ObjC TypeLocs. Preserve the spelling of protocol lists except in the canonical form. * Preserve some level of source type structure on parameter types, but canonicalize on the canonical function type. This is still a WIP. Drops code size, makes strides towards accurate source location representation, slight (~1.7%) progression on Cocoa.h because of complexity drop. llvm-svn: 84907
* Don't (directly) call RequireCompleteType with an invalid source location.Douglas Gregor2009-10-211-1/+1
| | | | llvm-svn: 84793
* Change FixOverloadedFunctionReference to return a (possibly new) expression. ↵Anders Carlsson2009-10-211-1/+1
| | | | | | Substitute TemplateIdRefExprs with DeclRefExprs. Doug, plz review :) llvm-svn: 84763
* It's OK for a pure virtual function to override another pure virtual ↵Anders Carlsson2009-10-181-4/+2
| | | | | | function. Fixes PR5222. llvm-svn: 84428
* Testing and some minor fixes for explicit template instantiation.Douglas Gregor2009-10-141-1/+1
| | | | llvm-svn: 84129
* Handle ambiguity of reference initialization.Fariborz Jahanian2009-10-141-1/+10
| | | | | | Removes a FIXME. llvm-svn: 84068
* Remove some non-ASCII charactersDouglas Gregor2009-10-131-2/+2
| | | | llvm-svn: 84058
* Unify our diagnostic printing for errors of the form, "we didn't likeDouglas Gregor2009-10-131-1/+2
| | | | | | | | | | what we found when we looked into <blah>", where <blah> is a DeclContext*. We can now format DeclContext*'s in nice ways, e.g., "namespace N", "the global namespace", "'class Foo'". This is part of PR3990, but we're not quite there yet. llvm-svn: 84028
* Diagnose attempts to add default function arguments to aDouglas Gregor2009-10-131-0/+16
| | | | | | specialization. This completes C++ [temp.expl.spec]! llvm-svn: 83980
* Improve the internal representation and semantic analysis of friendDouglas Gregor2009-10-131-3/+2
| | | | | | | | | | | | | | | function templates. This commit ensures that friend function templates are constructed as FunctionTemplateDecls rather than partial FunctionDecls (as they previously were). It then implements template instantiation for friend function templates, injecting the friend function template only when no previous declaration exists at the time of instantiation. Oh, and make sure that explicit specialization declarations are not friends. llvm-svn: 83970
* Test exception spec compatibility on return type and parameters.Sebastian Redl2009-10-111-10/+0
| | | | | | | Along the way, use RequireCompleteType when testing exception spec types. Separate all the ugly spec stuff into its own file. llvm-svn: 83764
* Implement the core checking for compatible exception specifications in ↵Sebastian Redl2009-10-101-1/+7
| | | | | | | | | assignment and initialization. The exception specification of the assignee must be the same or a subset of the target. In addition, exception specifications on arguments and return types must be equivalent, but this is not implemented yet. This currently produces two diagnostics for every invalid assignment/initialization, due to the diagnostic produced outside PerformImplicitConversion, e.g. in CheckSingleInitializer. I don't know how to suppress this; in any case I think it is the wrong place for a diagnostic, since there are other diagnostics produced inside the function. So I'm leaving it as it is for the moment. llvm-svn: 83710
* Refactor the LookupResult API to simplify most common operations. Require ↵John McCall2009-10-091-17/+26
| | | | | | | | | users to pass a LookupResult reference to lookup routines. Call out uses which assume a single result. llvm-svn: 83674
* Fix up error reporting when object cannot be constructed Fariborz Jahanian2009-10-081-2/+3
| | | | | | | because of missing default constructor of a member. Fixes pr5154. llvm-svn: 83583
* Refactoring around friend class templates. Better error message for friend ↵John McCall2009-10-071-17/+9
| | | | | | | | enums. Don't create a new declaration for friend classes if a declaration already exists. llvm-svn: 83505
* Refactor the code that walks a C++ inheritance hierarchy, searchingDouglas Gregor2009-10-061-4/+138
| | | | | | | | | for bases, members, overridden virtual methods, etc. The operations isDerivedFrom and lookupInBases are now provided by CXXRecordDecl, rather than by Sema, so that CodeGen and other clients can use them directly. llvm-svn: 83396
* Anonymous namespaces, sema + codegen. A lot of semantics are still broken,John McCall2009-10-011-1/+32
| | | | | | apparently because using directives aren't quite working correctly. llvm-svn: 83184
* Issue good diagnostics when initializing a refernce type withFariborz Jahanian2009-09-301-3/+8
| | | | | | a bad initializer. Fixes pr4274. llvm-svn: 83169
* Desugaring optimizations. Add single-step desugaring methods to allJohn McCall2009-09-291-3/+3
| | | | | | | | | concrete types. Use unqualified desugaring for getAs<> and sundry. Fix a few users to either not desugar or use qualified desugar, as seemed appropriate. Removed Type's qualified desugar method, as it was easy to accidentally use instead of QualType's. llvm-svn: 83116
* Introduce ObjCProtocolListLoc for keeping source location information for ↵Argyrios Kyrtzidis2009-09-291-1/+2
| | | | | | protocol references. llvm-svn: 83094
* Minor API change. No change in functionality.Fariborz Jahanian2009-09-281-1/+1
| | | | llvm-svn: 83022
* Improve handling of friend function templates somewhatDouglas Gregor2009-09-281-41/+19
| | | | llvm-svn: 82950
* Rework the Parse-Sema interaction for friends to better support friendDouglas Gregor2009-09-261-8/+0
| | | | | | | | | class templates. We now treat friend class templates much more like normal class templates, except that they still get special name lookup rules. Fixes PR5057 and eliminates a bunch of spurious diagnostics in <iostream>. llvm-svn: 82848
* Refactor the representation of qualifiers to bring ExtQualType out of theJohn McCall2009-09-241-11/+9
| | | | | | | | Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our use of qualifiers and fix a few places that weren't dealing with qualifiers quite right; many more remain. llvm-svn: 82705
* Use Doug's DeclLoc to pinpoint location of the declarationFariborz Jahanian2009-09-241-1/+1
| | | | | | in a reference initialization diagnostic. llvm-svn: 82671
* Improve diagnostic location information when checking the initialization of ↵Douglas Gregor2009-09-231-14/+11
| | | | | | a reference llvm-svn: 82666
* patch to ir-gen conversion function call used inFariborz Jahanian2009-09-231-4/+9
| | | | | | initializing a reference class. llvm-svn: 82664
* Remove the FIXME as I said.Fariborz Jahanian2009-09-231-1/+0
| | | | llvm-svn: 82650
* This patch addresses a few issues related to 8.5.3 [dcl.init.ref]Fariborz Jahanian2009-09-231-3/+23
| | | | | | | | | It uses a recent API to find inherited conversion functions to do the initializer to reference lvalue conversion (and removes a FIXME). It issues the ambiguity diagnostics when multiple conversions are found. WIP. llvm-svn: 82649
* Change all the Type::getAsFoo() methods to specializations of Type::getAs().John McCall2009-09-211-13/+13
| | | | | | | | | | | Several of the existing methods were identical to their respective specializations, and so have been removed entirely. Several more 'leaf' optimizations were introduced. The getAsFoo() methods which imposed extra conditions, like getAsObjCInterfacePointerType(), have been left in place. llvm-svn: 82501
* Merge uninstantiated default arguments more carefully, and try not toDouglas Gregor2009-09-171-2/+6
| | | | | | | complain about specializations of member functions that are not definitions. Fixes PR4995. llvm-svn: 82159
* Improved representation and support for friend class templates. Angst about ↵John McCall2009-09-161-33/+55
| | | | | | same. llvm-svn: 82088
* When implicitly declaring operators new, new[], delete, and delete[],Douglas Gregor2009-09-151-0/+15
| | | | | | | | | | | | give them the appropriate exception specifications. This, unfortunately, requires us to maintain and/or implicitly generate handles to namespace "std" and the class "std::bad_alloc". However, every other approach I've come up with was more hackish, and this standard requirement itself is quite the hack. Fixes PR4829. llvm-svn: 81939
* Add back the workaround since it lead to constructor conversion bugs :(Anders Carlsson2009-09-151-0/+6
| | | | llvm-svn: 81917
* When performing an user defined conversion sequence, perform the initial ↵Anders Carlsson2009-09-151-6/+0
| | | | | | standard conversion sequence. This lets us remove a workaround in SemaCompleteConstructorCall. llvm-svn: 81847
OpenPOWER on IntegriCloud