nayakgi / perl-compiler

Automatically exported from code.google.com/p/perl-compiler
Other
0 stars 0 forks source link

Compilation failed when inherited B::AUTOLOAD #276

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

> perlcc -r -e 'package UNIVERSAL; sub AUTOLOAD { my $c = shift; print "$c 
$AUTOLOAD\n" } package Xyz; package main; Foo->Bar->[0](); print "ok\n";'
pccVJQfI.c:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘:’ token
pccVJQfI.c:540:3: error: too many decimal points in number
pccVJQfI.c:543:3: error: too many decimal points in number
pccVJQfI.c:37405:3: error: too many decimal points in number
pccVJQfI.c:37408:3: error: too many decimal points in number
In file included from 
/usr/local/cpanel/3rdparty/perl/514/lib/perl5/5.14.4/i386-linux-64int-debug/CORE
/perl.h:612,
                 from pccVJQfI.c:40043:
/usr/include/sys/types.h:34: error: expected ‘=’, ‘,’, ‘;’, 
‘asm’ or ‘__attribute__’ before ‘u_char’
pccVJQfI.c:66333: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘:’ token
pccVJQfI.c:66389:3: error: too many decimal points in number
pccVJQfI.c:66393:3: error: too many decimal points in number
Illegal division by zero at -e line 1.

What is the expected output? 

> perl -e 'package UNIVERSAL; sub AUTOLOAD { my $c = shift; print "$c 
$AUTOLOAD\n" } package Xyz; package main; Foo->Bar->[0](); print "ok\n";'
IO::File=IO(0x9127a58) IO::File::DESTROY
Foo Foo::Bar
Use of inherited AUTOLOAD for non-method main::() is deprecated at -e line 1.
 main::
ok

Please use labels and text to provide additional information.

Original issue reported on code.google.com by nicolas....@gmail.com on 23 Jan 2014 at 11:11

GoogleCodeExporter commented 9 years ago
Most likely a WontFix. Defining a UNIVERSAL::AUTOLOAD method renders any 
compiler unusable.

Original comment by reini.urban on 24 Jan 2014 at 6:15

GoogleCodeExporter commented 9 years ago
CORE/op/method.t can be fixed by replacing B:: with Z::
so B::AUTOLOAD will be Z::AUTOLOAD

But using UNIVERSAL::AUTOLOAD is a WontFix

Original comment by reini.urban on 3 Feb 2014 at 4:54