[Issue 17541] Function attribute deduction depends on compile invocation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 24 18:57:40 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=17541

--- Comment #12 from johanengelen at weka.io ---
(In reply to Walter Bright from comment #11)
> I cannot reproduce the problem. The previous fix I pushed was wrong.
> 
> The pragma(msg, insertabcdefg.mangleof) gives the wrong name mangling, as it
> happens before the inference is complete. The compiler should give an error
> for that.

The pragma(msg, insertabcdefg.mangleof) is not the only bug here. The larger
pain point is that deduction depends on compiler invocation and hence breaks
separate compilation (either for linking symbol resolution, or for code
depending on a certain attribute deduction result).
Tested with dlang 2.090.1 just now, replacing `@nogc` with `pure`, and
following reproduction commands shows the problem:

❯ ~/dlang/dmd20901/osx/bin/dmd one.d -c -of=tmp1.o
                                                                               
                                                                               
                          ❯ nm tmp1.o| grep "insertabc"
00000000000002ac S __D5three__T2TTTiZQg13insertabcdefgMFNaiZv
0000000000000078 S __D5three__T2TTTiZQg13insertabcdefgMFNaiZv.eh

❯ dmd one.d two.d three.d -c -of=tmp2.o

❯ nm tmp2.o | grep "insertabc"
00000000000003b4 S __D5three__T2TTTiZQg13insertabcdefgMFiZv
00000000000000c0 S __D5three__T2TTTiZQg13insertabcdefgMFiZv.eh

The symbol names in the binary are different.

--


More information about the Digitalmars-d-bugs mailing list