summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOverload.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement basic support for converting constructors in user-defined Douglas Gregor2008-10-311-32/+160
| | | | | | | | | | | | | conversions. Notes: - Overload resolution for converting constructors need to prohibit user-defined conversions (hence, the test isn't -verify safe yet). - We still use hacks for conversions from a class type to itself. This will be the case until we start implicitly declaring the appropriate special member functions. (That's next on my list) llvm-svn: 58513
* Implement semantic checking of static_cast and dynamic_cast.Sebastian Redl2008-10-311-13/+25
| | | | llvm-svn: 58509
* Implement overloading rules for reference bindingDouglas Gregor2008-10-291-15/+101
| | | | llvm-svn: 58381
* Tweak Sema::CheckReferenceInit so that it (optionally) computes an Douglas Gregor2008-10-291-5/+5
| | | | | | | | | | | ImplicitConversionSequence and, when doing so, following the specific rules of [over.best.ics]. The computation of the implicit conversion sequences implements C++ [over.ics.ref], but we do not (yet) have ranking for implicit conversion sequences that use reference binding. llvm-svn: 58357
* Implement initialization of a reference (C++ [dcl.init.ref]) as partDouglas Gregor2008-10-291-33/+82
| | | | | | | | | | | | | | | | | | | of copy initialization. Other pieces of the puzzle: - Try/Perform-ImplicitConversion now handles implicit conversions that don't involve references. - Try/Perform-CopyInitialization uses CheckSingleAssignmentConstraints for C. PerformCopyInitialization is now used for all argument passing and returning values from a function. - Diagnose errors with declaring references and const values without an initializer. (Uses a new Action callback, ActOnUninitializedDecl). We do not yet have implicit conversion sequences for reference binding, which means that we don't have any overloading support for reference parameters yet. llvm-svn: 58353
* Some cleanups for the ambiguous derived-to-base conversion checksDouglas Gregor2008-10-241-3/+3
| | | | llvm-svn: 58096
* First non-embarrassing cut at checking for ambiguous derived-to-base Douglas Gregor2008-10-241-1/+30
| | | | | | | | | | conversions. Added PerformImplicitConversion, which follows an implicit conversion sequence computed by TryCopyInitialization and actually performs the implicit conversions, including the extra check for ambiguity mentioned above. llvm-svn: 58071
* Add support for conversions from a pointer-to-derived to aDouglas Gregor2008-10-231-7/+138
| | | | | | | | | | | | pointer-to-base. Also, add overload ranking for pointer conversions (for both pointer-to-void and derived-to-base pointer conversions). Note that we do not yet diagnose derived-to-base pointer conversion errors that stem from ambiguous or inacessible base classes. These aren't handled during overload resolution; rather, when the conversion is actually used we go ahead and diagnose the error. llvm-svn: 58017
* Add representation of base classes in the AST, and verify that weDouglas Gregor2008-10-221-2/+2
| | | | | | | | don't have duplicated direct base classes. Seriliazation of base class specifiers is not yet implemented. llvm-svn: 57991
* QualType::isMoreQualifiedThan and isAtLeastAsQualifiedAs assert that weDouglas Gregor2008-10-221-0/+1
| | | | | | | | | aren't trying to compare with address-space qualifiers (for now). Clean up handing of DeclRefExprs in Expr::isLvalue and refactor part of the check into a static DeclCanBeLvalue. llvm-svn: 57980
* Implement ranking of standard conversion sequences by their qualificationDouglas Gregor2008-10-221-36/+116
| | | | | | | | | | | | conversions (e.g., comparing int* -> const int* against int* -> const volatile int*); see C++ 13.3.3.2p3 bullet 3. Add Sema::UnwrapSimilarPointerTypes to simplify the control flow of IsQualificationConversion and CompareQualificationConversion (and fix the handling of the int* -> volatile int* conversion in the former). llvm-svn: 57978
* Fix a thinko in the qualification-conversion check when the qualificaitons ↵Douglas Gregor2008-10-221-1/+1
| | | | | | are disjoint, and add some overloading-based tests of qualification conversions llvm-svn: 57942
* Initial step toward supporting qualification conversions (C++ 4.4).Douglas Gregor2008-10-211-4/+95
| | | | | | | | | | | | | | | | | | | | Changes: - Sema::IsQualificationConversion determines whether we have a qualification conversion. - Sema::CheckSingleAssignment constraints now follows the C++ rules in C++, performing an implicit conversion from the right-hand side to the type of the left-hand side rather than checking based on the C notion of "compatibility". We now rely on the implicit-conversion code to determine whether the conversion can happen or not. Sema::TryCopyInitialization has an ugly reference-related hack to cope with the initialization of references, for now. - When building DeclRefExprs, strip away the reference type, since there are no expressions whose type is a reference. We'll need to do this throughout Sema. - Expr::isLvalue now permits functions to be lvalues in C++ (but not in C). llvm-svn: 57935
* Preliminary support for function overloadingDouglas Gregor2008-10-211-0/+903
llvm-svn: 57909
OpenPOWER on IntegriCloud