Commit 758333e9 authored by root's avatar root

Now has a legitimate warning message.

parent 27585bf1
# Can be enabled at the command line with --debug-xxx.
debug_disposal_code = 0
debug_temp_alloc = 1
debug_temp_alloc = 0
debug_coercion = 0
# Write comments into the C code that show where temporary variables
......
......@@ -11377,6 +11377,10 @@ class CoerceFromPyTypeNode(CoercionNode):
if not result_type.create_from_py_utility_code(env):
error(arg.pos,
"Cannot convert Python object to '%s'" % result_type)
elif result_type.is_reference:
warning(arg.pos,
"Cannot pass Python object as %s reference, will pass by copy." % result_type,
level=1)
if self.type.is_string or self.type.is_pyunicode_ptr:
if self.arg.is_name and self.arg.entry and self.arg.entry.is_pyglobal:
warning(arg.pos,
......
......@@ -2393,7 +2393,7 @@ def p_c_array_declarator(s, base):
s.expect(']')
return Nodes.CArrayDeclaratorNode(pos, base = base, dimension = dim)
def p_c_func_declarator(s, pos, ctx, base, cmethod_flag):
def p_c_func_declarator(s, pos, ctx, base, cmethod_flag):
# Opening paren has already been skipped
args = p_c_arg_list(s, ctx, cmethod_flag = cmethod_flag,
nonempty_declarators = 0)
......
......@@ -4,7 +4,6 @@
from __future__ import absolute_import
import re
import copy
import re
......@@ -12,7 +11,7 @@ from .Code import UtilityCode, LazyUtilityCode, TempitaUtilityCode
from . import StringEncoding
from . import Naming
from .Errors import error, warning
from .Errors import error
class BaseType(object):
......@@ -3287,10 +3286,6 @@ class CppClassType(CType):
tags = type_identifier(self),
else:
cls = self.cname[5:]
if self.is_reference:
warning("dwqkokw", -1)
print "warned"
cname = '__pyx_convert_%s_from_py_%s' % (cls, '__and_'.join(tags))
context = {
'template_type_declarations': '\n'.join(declarations),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment