* fix for Mantis #38145: allow overloading of assignment operators that return ShortStrings with a specific size
+ added tests
The following rules for using these operator overloads as *implicit* overloads apply (Delphi compatible):
- if a found assignment operator returns a default ShortString then that is used
- if only one assignment operator to a String[x] is found then that is used
- otherwise the assignment is not possible
The explicit assignment checks for an exact match (and falls back for an implicit assignment). This is not entirely Delphi compatible as Delphi seems to favor the first found symbol in that case, but sometimes also not... :/
........
* with the recent ShortString changes this test is no longer needed as it was added exactly to check the condition I removed, so disable it for 3.2.1 and newer (as I want to merge these changes back to fixes)
........
git-svn-id: branches/fixes_3_2@49055 -
U compiler/htypechk.pas
U compiler/ncal.pas
A tests/webtbs/tw37796.pp
-- Aufzeichnung der Informationen für Zusammenführung von r46973 in ».«:
U .
git-svn-id: branches/fixes_3_2@47908 -
* fix for Mantis #36706: only link a library against the dynamic loader if we're not linking against the C library anyway
Note: I did not yet find a case where we *do* need to link a library against the loader; this will have to be investigated further, but for 3.2.0 this is safest
........
* fix for Mantis #36738: when copying a record using its copy operator we assume that we've copied the whole record; this way managed records inside non-managed records are handled correctly
+ added (adjusted) test
........
* when checking for an existing operator overload for the assignment operator, check for the correct variant (explicit or not) matching the overload
+ added tests
........
* GetLoadErrorStr (currently) returns a ShortString, so avoid a useless conversion to AnsiString
........
git-svn-id: branches/fixes_3_2@47771 -
* ensure that the correct amount of parameters is used for an operator overload (this is essentially important for unary operators that were declared with two arguments)
........
* fix for Mantis #35348: correctly handle symbols that aren't parameter types (e.g. default values)
+ added test
........
git-svn-id: branches/fixes_3_2@47587 -
U compiler/ninl.pas
--- Recording mergeinfo for merge of r40180 into '.':
U .
--- Merging r40216 into '.':
U compiler/htypechk.pas
G compiler/ninl.pas
U tests/tbf/tb0258.pp
A tests/tbf/tb0259.pp
A tests/tbf/tb0260.pp
A tests/tbs/tb0653.pp
--- Recording mergeinfo for merge of r40216 into '.':
G .
--- Merging r40217 into '.':
U compiler/systems/t_bsd.pas
--- Recording mergeinfo for merge of r40217 into '.':
G .
--- Merging r40218 into '.':
G compiler/systems/t_bsd.pas
--- Recording mergeinfo for merge of r40218 into '.':
G .
git-svn-id: branches/fixes_3_2@44000 -
U compiler/msg/errore.msg
--- Recording mergeinfo for merge of r40654 into '.':
U .
--- Merging r40656 into '.':
U compiler/pdecvar.pas
A tests/tbf/tb0266a.pp
A tests/tbf/tb0266b.pp
--- Recording mergeinfo for merge of r40656 into '.':
G .
--- Merging r41308 into '.':
U tests/webtbs/tw35027.pp
--- Recording mergeinfo for merge of r41308 into '.':
G .
--- Merging r41829 into '.':
U compiler/htypechk.pas
U compiler/ncal.pas
A tests/tbs/tb0656.pp
--- Recording mergeinfo for merge of r41829 into '.':
G .
--- Merging r42511 into '.':
U packages/rtl-objpas/src/inc/rtti.pp
U rtl/objpas/typinfo.pp
U tests/test/trtti19.pp
--- Recording mergeinfo for merge of r42511 into '.':
G .
# revisions: 40654,40656,41308,41829,42511
git-svn-id: branches/fixes_3_2@43410 -
* compinnr.inc include file converted to a unit
* inline number field size stored in ppu increased from byte to longint
* inlines in the parse tree (when written with the -vp option) now printed with
their enum name, instead of number
git-svn-id: trunk@36174 -
only used in combination with subscriptn/vecn to determine whether the
target is assignable (and we return true immediately if you subscript
or index an implicit pointer type -- also for classrefdef now)
o disallow assigning something to fields of records returned by functions
(that would be assigned to a temp and get lost anyway)
git-svn-id: trunk@35313 -
where it used to be set to true (dereferencing a pointer always means
that regardless of what the pointer was, the resut is assignable)
(mantis #22979)
o also removed gotpointer, since it was only used in combination with
gotderef
git-svn-id: trunk@35308 -
the scope penalty relative to the nearest symtable that contains one of
the applicable overloads, rather than relative to the nearest symtable
that simply contains a method with this name (based on patch by
Maciej Izak, mantis #25607)
git-svn-id: trunk@35089 -
and getters for the ttemp*node classes instead
o this will allow descendants to prevent certain flags from being added
or removed. E.g. for LLVM, certain temps must never be put in registers
because it cannot typecast a value in a register from a non-record/array
type to an array type without forcing it to memory (so if that is done
on an lvalue, the result will be written to the memory temp instead of
to the register)
git-svn-id: trunk@34358 -
htypechk.pas, tcallcandidates:
* create_candidate_list: check the correct tableoptions for sto_has_overload flag
+ added test
git-svn-id: trunk@33211 -
htypechk.pas, tcallcandidates:
* create_candidate_list: don't check whether the pd is a specialization if the owner is valid; happens if a generic method is used more than once (which should happen here and then :P )
+ added test
git-svn-id: trunk@33037 -
* extend tcallnode with the ability to pass a tspecializationcontext so that tcallcandidates can do a final specialization
* the final procdef is registered at the end of tcallnode.pass_typecheck
git-svn-id: trunk@31763 -
dynamic arrays and fixed-length static arrays when looking for
overloads of array constructors, while these are not valid in
such cases (and it also gave an error afterwards when trying to
actually use them). This caused a lot of spurious "can't select
which overloaded routine to call" errors when using many JVM
routines
git-svn-id: trunk@29393 -
htypechk.pas, tcallcandidates:
* collect_overloads_in_struct: we need to check the deftyp of the extended def for record- or objectdef, not the deftyp of the helper which will always be objectdef anyway.
+ added test
git-svn-id: trunk@28572 -
defcmp.pas:
+ add new function "def_is_related" which combines the "is_related" overloads of "tobjectdef", "trecorddef" and "tstringdef" (it returns "false" for other def types which is what "tdef.is_related" did)
* compare_defs_ext & compatible_childmethod_resultdef: change call from "x.is_related" to "def_is_related(x,...)"
symtype.pas, tdef:
- remove "is_related" method
symdef.pas:
- remove "is_related" in "tobjectdef", "trecorddef" and "tstringdef"
* tobjectdef.needs_inittable: for checking whether a Corba interface somehow inherits from a IInterface don't use "is_related" anymore (we want to avoid the dependency after all), but mimic the necessary functionality of "def_is_related"
htypechk.pas, nadd.pas, ncal.pas, ncnv.pas, ngtcon.pas, nld.pas, optvirt.pas, pdecobj.pas, pdecvar.pas, pexpr.pas, pgenutil.pas:
* change call from "x.is_related" to "def_is_related(x,...)"
symtable.pas
+ use unit defcmp
* change call from "x.is_related" to "def_is_related(x,...)"
jvm/njvmcnv.pas, jvm/njvmflw.pas:
* change call from "x.is_related" to "def_is_related(x,...)"
git-svn-id: trunk@25847 -
symconst.pas:
+ add "sto_has_operator" to "tsymtableoption"
pdecsub.pas:
+ include the flag "sto_has_operator" for all operator declarations and their owning symtables
htypechk.pas, tcallcandidates:
* create_candidate_list: only check for operator overloads if the record does indeed declare some
* collect_overloads_in_units: only check for operator overloads if the unit does indeed declare some
utils/ppudump.pp:
+ respect the new "sto_has_operator" flag
git-svn-id: trunk@23688 -