Commit Graph

324 Commits

Author SHA1 Message Date
paul
3ceee496d6 tests: fail test tw9509: disable type section in generic interfaces
git-svn-id: trunk@16680 -
2011-01-02 10:51:51 +00:00
Jonas Maebe
3a089cea10 * give an error when trying to let an objcclass conform to a
forward-declared objcprotocol (mantis #17341)

git-svn-id: trunk@16523 -
2010-12-08 22:17:24 +00:00
florian
7d1627e9ca * patch by Aleksa Todorovic to handle access to types inside generics correctly
when they are used as class variables, resolves #18096

git-svn-id: trunk@16474 -
2010-11-29 09:37:09 +00:00
Jonas Maebe
14b95b3b9b * always force range checking for the upper and lower bounds of for-loops if
they are constants (instead of only on 32 bit systems), and always use the
    actual upper/lower bound of the loop variable instead of hardcoding the
    bounds of longint (mantis #17646)

git-svn-id: trunk@16213 -
2010-10-24 14:55:48 +00:00
Jonas Maebe
db8a67747d * give an error when trying to use (bit)sizeof on a type that is not yet
resolved by the compiler (mantis #14354)

git-svn-id: trunk@16112 -
2010-10-08 17:42:53 +00:00
Jonas Maebe
bd0567563c * don't crash in {$x-} mode if a call cannot be resolved due to an error
in the expression (mantis #17455)

git-svn-id: trunk@16061 -
2010-09-29 12:11:22 +00:00
Jonas Maebe
9273856e84 * disallow pusha*/popa* for x86_64 (mantis #14862)
* disallow pushfd/popfd for x86_64 (mantis #14862)
  * fixed assembling popfq with the internal assembler (it needs a rex.w
    prefisx, while pushfq doesn't)
  * changed the default opcode size of pushf/popf/pusha/popa in
    {$asmmode intel} from "native size" to 16 bit (compatible with Intel
    manuals and Kylix; in AT&T mode, the default size for those operations
    remains the native one)
  * changed pushf/popf in rtl/i386/* into pushfd/popfd because of the
    previous change

git-svn-id: trunk@15546 -
2010-07-10 16:22:46 +00:00
Jonas Maebe
cddb2ffcae * give a compile-time error when trying to define a short/ansistring typed constant
containing unicode strings instead of producing unpredictable behaviour
    (mantis #16219)

git-svn-id: trunk@15240 -
2010-05-08 10:57:39 +00:00
Jonas Maebe
72758864e4 * only allow field names in record/object typed constant declarations (mantis #16234)
* improved error recovery after encountering invalid field name in record/object typed constant
    declaration

git-svn-id: trunk@15150 -
2010-04-18 07:55:42 +00:00
Jonas Maebe
35941dcae9 * added missing -CO option
git-svn-id: trunk@15056 -
2010-03-25 09:10:41 +00:00
Jonas Maebe
653974f679 * also give a "potential range error" hint with -CO in case the sizes
match but the source range does not fit in the dest range
    (related to mantis #16023)
  * don't give a "potential range error" when converting between
    s80real and sc80real, since even though the size may differ,
    the represented range does not

git-svn-id: trunk@15044 -
2010-03-24 21:21:19 +00:00
Jonas Maebe
6db635210a * don't give an internalerror when passing a constant string to an
openstring parameter (mantis #16022)

git-svn-id: trunk@15030 -
2010-03-21 14:51:12 +00:00
Jonas Maebe
0cfc6e1cac + support for "univ" in macpas mode: a parameter modifier that allows
passing any value to that parameter which has the same size as the
    parameter (it basically acts as if there is an explicit type conversion
    to the parameter type around the value at the caller side). If a procvar
    has an univ parameter, all procvars whose corresponding parameter
    has the same size as that univ parameter are similarly compatible.

    This transparent compatibility can however cause crashes in case of
    of the procvars when one of the types is passed on the stack and the
    other isn't (because then the called routine will a) load the parameter
    from a wrong location and b) pop the wrong amount off of the stack at
    then end). Therefore FPC will warn in most cases where this can happen.
    (mantis #15777)

git-svn-id: trunk@15010 -
2010-03-13 22:13:20 +00:00
Jonas Maebe
88f5addd1c * do not typecheck statements before checking whether they are valid,
because the associated simplifications can turn invalid statements
    into valid statements (based on patch by Aleksa Todorovic, mantis
    #15594)

git-svn-id: trunk@14998 -
2010-03-09 21:13:22 +00:00
Jonas Maebe
6b0a0c149b * don't perform a range check in Delphi mode when passing a cardinal as
vtInteger to an array-of-const parameter (mantis #15727)

git-svn-id: trunk@14882 -
2010-02-10 16:35:37 +00:00
paul
00624ad7a3 tests: remove {$STATIC ON} directive since it is not available anymore
git-svn-id: trunk@14580 -
2010-01-08 18:01:28 +00:00
paul
8166148a37 compiler: 'static' keyword:
- deprecate -St compiler switch
  - remove $STATIC directive
  - unconditionally enable 'static' keyword usage
  - adopt tests, samplecfg, fpc.cft, error messages

git-svn-id: trunk@14569 -
2010-01-07 19:02:09 +00:00
Jonas Maebe
dd94f5cf2b * no longer allow typed files of reference counted data (mantis #15447)
git-svn-id: trunk@14509 -
2010-01-01 14:56:33 +00:00
Jonas Maebe
e254d607d6 * support arrayconstructornodes of procvars (mantis #15391)
git-svn-id: trunk@14468 -
2009-12-23 20:11:35 +00:00
Jonas Maebe
0247d0c2ee * use calling convention that is not the default on any platform
git-svn-id: trunk@14399 -
2009-12-11 09:36:11 +00:00
Jonas Maebe
164db72f07 * implements getter must used target's default calling convention, because
it's called indirectly via an RTL helper that expects this (mantis #15303)

git-svn-id: trunk@14397 -
2009-12-10 21:47:47 +00:00
Jonas Maebe
b521f80b13 * give a proper error when a rangen appears in a vecn that's not an
array parameter (mantis #15287)

git-svn-id: trunk@14368 -
2009-12-08 18:47:24 +00:00
Jonas Maebe
b9b95a8f73 * fixed compiler crash when putting non-constant string in a set expression
(mantis #15288)

git-svn-id: trunk@14367 -
2009-12-08 17:15:31 +00:00
Jonas Maebe
8d65471fe2 * give a proper error when trying to use val() on a boolean (mantis #14777)
* don't allow a boolean or (wide)char to be used as the "error" parameter
    for val()

git-svn-id: trunk@14006 -
2009-11-01 17:18:40 +00:00
Jonas Maebe
3e624d990d * only allow one "message" modifier per method declaration (mantis #14946)
git-svn-id: trunk@14001 -
2009-11-01 15:23:57 +00:00
Jonas Maebe
d61eb3528f * make strict string var checking ({$v+}) the default in TP and Delphi modes
(mantis #14929)

git-svn-id: trunk@13966 -
2009-10-29 15:52:14 +00:00
Jonas Maebe
dd937bd32d * don't crash when looking for a local/parasym while current_procinfo is
nil, such as while parsing a property definition (mantis #14849)

git-svn-id: trunk@13958 -
2009-10-26 13:48:58 +00:00
Jonas Maebe
fffa66e2f9 * only allow implicit conversions from 0 to NIL in Delphi mode, rather than
from any ordinal constant, and give a warning for this one allowed
    conversion like Kylix does (mantis #14713)
  * this required calling simplify from typecheckpass in ttypeconvnode for
    cord_to_pointer, because this simplification prevents the type checking
    from happening (but the typecheck itself also does that simplification)

git-svn-id: trunk@13919 -
2009-10-22 19:49:08 +00:00
Jonas Maebe
b8a28ff5da * zapped gremlins that threw off dotest's detection of the %fail
git-svn-id: trunk@13798 -
2009-10-03 20:32:46 +00:00
Jonas Maebe
1eceb2ca65 * don't allow properties to expose private fields of parent classes
(mantis #14650)

git-svn-id: trunk@13794 -
2009-10-02 13:50:52 +00:00
Jonas Maebe
ae6200ce72 + tests forgotten to commit as part of r13334
git-svn-id: trunk@13617 -
2009-08-30 08:37:53 +00:00
florian
f2a1d8edf6 * moved test to proper location
git-svn-id: trunk@13552 -
2009-08-18 06:53:50 +00:00
florian
6ea40be296 * fixed more properties, I still wonder how this could be commited
git-svn-id: trunk@13543 -
2009-08-16 10:57:52 +00:00
florian
6c99746074 * forbid the usage of Result(x) as function call, resolves #14248
git-svn-id: trunk@13492 -
2009-08-06 19:06:23 +00:00
Jonas Maebe
79f139bff7 + tests for previous commit
git-svn-id: trunk@13373 -
2009-07-08 20:22:09 +00:00
Jonas Maebe
e42842b31c * don't allow skipping property parameters if the getter/setter has default
parameters (mantis #13956)
  * when reporting an error about too few specified parameters to a call,
    return the column of the call itself rather than after the last parameter
    (because this ends up after the end of an indexed property in case of
     properties, which is confusing)

git-svn-id: trunk@13326 -
2009-06-26 17:31:41 +00:00
Jonas Maebe
47702aa3a5 * disallow new(property) (mantis #13992)
git-svn-id: trunk@13288 -
2009-06-18 09:23:43 +00:00
Jonas Maebe
e6bf70fc05 * fixed/cleaned up tests for "nil + 1"
git-svn-id: trunk@13212 -
2009-05-30 11:29:54 +00:00
Jonas Maebe
10158da60e * give an error when trying to use the offset of a non-byte-aligned field
of a bitpacked record in assembler code
  * convert the offsets of byte-aligned fields of bitpacked records from bits
    to bytes (mantis #13563)

git-svn-id: trunk@13027 -
2009-04-23 17:27:44 +00:00
Jonas Maebe
40247d2d87 * give an error when the typeinfo() function is called for an enumeration
whose base is not 0, or that has jumps in its value range (manits #9551)

git-svn-id: trunk@12960 -
2009-03-22 20:54:49 +00:00
Jonas Maebe
549f1ecc1b * when using overloaded functions in Delphi mode without the "overload"
directive, state that "overload" is missing rather than that
    overloading is disabled (mantis #10081)

git-svn-id: trunk@12723 -
2009-02-08 16:01:41 +00:00
Jonas Maebe
2929624ffc * accept overloaded operators that return any shortstring type when needing
a conversion to a shortstring type (so an operator := that returns a
    string[255] can be used to assign this type to a string[80]) (mantis
    #12109)
  * do not allow overloading := with a string[x<>255] as result type,
    because we want one such overload to satisfy all conversions (see
    previous point)

git-svn-id: trunk@12590 -
2009-01-24 15:12:19 +00:00
Jonas Maebe
8ad1500438 * disallow passing descendent interfaces to var parameters (mantis #12933)
git-svn-id: trunk@12535 -
2009-01-10 19:47:52 +00:00
florian
499c523346 * accept only valid guid as iid for com and dispinterfaces, resolves #12030; I'am not sure though if this isn't a feature used by people already
git-svn-id: trunk@12380 -
2008-12-17 22:09:21 +00:00
Jonas Maebe
f07d00b7f0 * changed test so it also produces a warning (and hence fails) on 64 bit
platforms

git-svn-id: trunk@12032 -
2008-11-07 20:00:06 +00:00
Jonas Maebe
e5920bc2b8 * delay verbosity changes just like localswitches changes
* store a node's verbosity in the node so that e.g. disabling warnings
    also disables warnings for this node in pass_1
   (the above together fix mantis #12076)
  * save/restore verbosity with {$push}/{$pop} (mantis #12075)
  * if warnings/notes/hints are turned off, also do not count encountered
    ones for the totals (otherwise -Sew cannot be used properly in
    combination with {$warnings off}, because disabled warnings will still
    trigger a compiler error) -- this required adding -vw/-vn/-vh to all
    tests using -Sew/-Sen/-Seh
  - removed some superfluous state saving/restoring from firstpass()

git-svn-id: trunk@12025 -
2008-11-03 21:18:27 +00:00
Jonas Maebe
658dd00f5f * more program header fixes
git-svn-id: trunk@12024 -
2008-11-03 20:19:38 +00:00
florian
937067e367 + check if forward definitions and real definitions have the same type, resolves #11970
git-svn-id: trunk@12017 -
2008-11-02 12:36:31 +00:00
florian
cb9e52826f * fix range check error in options handling, resolves #12365
+ better error output (print filename and line number) for config file directive errors

git-svn-id: trunk@11898 -
2008-10-14 17:06:55 +00:00
Jonas Maebe
79850c5027 * don't crash when someone uses an integer value to declare a wide/unicode
string (mantis #12329)

git-svn-id: trunk@11875 -
2008-10-10 15:01:56 +00:00