hanchenye-llvm-project/clang/test/SemaCXX
Douglas Gregor a11693bc37 Implement support for operator overloading using candidate operator
functions for built-in operators, e.g., the builtin

  bool operator==(int const*, int const*)

can be used for the expression "x1 == x2" given:

  struct X {
    operator int const*();
  } x1, x2;

The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it. 

There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.

Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.

As part of this change, ImplicitCastExpr can now be an lvalue.

llvm-svn: 59148
2008-11-12 17:17:38 +00:00
..
addr-of-overloaded-function.cpp Basic support for taking the address of an overloaded function 2008-11-10 20:40:00 +00:00
aggregate-initialization.cpp Sema-check virtual declarations. Complete dynamic_cast checking. 2008-11-06 15:59:35 +00:00
bool.cpp treat bool literals as constatnt expressions. 2008-08-23 21:12:35 +00:00
carbon.cpp Add carbon.cpp and cocoa.mm tests 2008-08-23 22:21:00 +00:00
class-names.cpp Move the rest of the Sema C++ tests into the SemaCXX test directory. 2008-08-22 15:43:49 +00:00
class.cpp Sema-check virtual declarations. Complete dynamic_cast checking. 2008-11-06 15:59:35 +00:00
condition.cpp Implement semantic checking of static_cast and dynamic_cast. 2008-10-31 14:43:28 +00:00
const-cast.cpp Remove workaround for reference. No longer necessary. 2008-10-29 19:45:21 +00:00
constructor-initializer.cpp Improve parser error recovery after a constructor initializer 2008-11-10 16:59:40 +00:00
constructor.cpp Semantic checking of constructor declarations and classification of default/copy constructors 2008-10-31 20:25:05 +00:00
conversion-function.cpp Parsing, ASTs, and semantic analysis for the declaration of conversion 2008-11-07 20:08:42 +00:00
converting-constructor.cpp Standard conversion sequences now have a CopyConstructor field, to 2008-11-03 19:09:14 +00:00
copy-initialization.cpp Implement C++ copy-initialization for declarations. There is now some 2008-11-05 15:29:30 +00:00
decl-expr-ambiguity.cpp Initial step toward supporting qualification conversions (C++ 4.4). 2008-10-21 23:43:52 +00:00
default1.cpp Now that we have copy initialization support, use it for checking the default arguments 2008-11-04 13:57:51 +00:00
default2.cpp Diagnose use of 'this' in a C++ default argument. Thanks to Eli for correcting my bogus assertion about it already being handled 2008-11-04 13:41:56 +00:00
derived-to-base-ambig.cpp First non-embarrassing cut at checking for ambiguous derived-to-base 2008-10-24 04:54:22 +00:00
destructor.cpp Changes in preparation for nested-name-specifiers. 2008-11-07 22:02:30 +00:00
direct-initializer.cpp Implement C++ copy-initialization for declarations. There is now some 2008-11-05 15:29:30 +00:00
do-while-scope.cpp Fix do-while scoping in C++. 2008-09-11 04:46:46 +00:00
dynamic-cast.cpp Sema-check virtual declarations. Complete dynamic_cast checking. 2008-11-06 15:59:35 +00:00
fntype-decl.cpp Simplify and correct the check for function redefinitions. This does two things: 2008-10-29 15:10:40 +00:00
function-type-qual.cpp Unbreak the test by.. removing a space. (clang protested that -verify only works on single input files). 2008-10-24 22:25:11 +00:00
inherit.cpp Add representation of base classes in the AST, and verify that we 2008-10-22 17:49:05 +00:00
namespace.cpp
nested-name-spec.cpp Introduce ScopedDecl::getLexicalDeclContext() which is different from ScopedDecl::getDeclContext() when there are nested-names. 2008-11-09 23:41:00 +00:00
overload-call-copycon.cpp Standard conversion sequences now have a CopyConstructor field, to 2008-11-03 19:09:14 +00:00
overload-call.cpp Simplify and correct the check for function redefinitions. This does two things: 2008-10-29 15:10:40 +00:00
overload-decl.cpp Preliminary support for function overloading 2008-10-21 16:13:35 +00:00
overloaded-builtin-operators.cpp Implement support for operator overloading using candidate operator 2008-11-12 17:17:38 +00:00
overloaded-operator-decl.cpp Parsing, ASTs, and semantic analysis for the declaration of overloaded 2008-11-06 22:13:31 +00:00
overloaded-operator.cpp Initial, rudimentary implementation of operator overloading for binary 2008-11-06 23:29:22 +00:00
qualification-conversion.cpp Initial step toward supporting qualification conversions (C++ 4.4). 2008-10-21 23:43:52 +00:00
references.cpp Implement C++ DR 106 and C++ DR 540, both of which deal with 2008-11-03 15:51:28 +00:00
reinterpret-cast.cpp Semantic analysis for C++ reinterpret_cast and const_cast. Patch by Sebastian Redl. 2008-10-24 15:36:09 +00:00
reinterpret-fn-obj-pedantic.cpp Semantic analysis for C++ reinterpret_cast and const_cast. Patch by Sebastian Redl. 2008-10-24 15:36:09 +00:00
return-stack-addr.cpp Refactor the expression class hierarchy for casts. Most importantly: 2008-10-27 19:41:14 +00:00
static-cast.cpp Greatly improve static_cast diagnostics 2008-11-07 23:29:29 +00:00
static-initializers.cpp Initial sema support for C++ static initializers. 2008-08-22 05:00:02 +00:00
this.cpp
type-convert-construct.cpp Give string literals const element typesin C++, and cope with the deprecated C++ conversion from a string literal to a pointer-to-non-const-character 2008-09-12 00:47:35 +00:00
typeid.cpp Implement C++ 'typeid' parsing and sema. 2008-11-11 11:37:55 +00:00
user-defined-conversions.cpp Allow user-defined conversions during reference binding 2008-11-10 16:14:15 +00:00
wchar_t.cpp Type::isIntegerType() returns true for types between Bool and LongLong. 2008-08-17 13:24:01 +00:00