Bug in Compiler? Can not declare a DefaultValue attribute with nullptr
Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance
Hello,
I guess, that a found a bug in the visual c++ compiler (version 2005).
If I try the following
public:
[
ComponentModel::Category ("Data"),
ComponentModel::DefaultValue (nullptr),
ComponentModel::Description ("The combo box that contains the data
source for this control")
]
property DbComboBox ^ ComboBox { DbComboBox ^ get(); Void set
(DbComboBox ^); }
then the compiler reports C2668:
d:\dotnet2005\nettools\source\DbTextBox.H(41) : error C2668:
'System::ComponentModel::DefaultValueAttribute::DefaultValueAttribute' :
ambiguous call to overloaded function
d:\windows\microsoft.net\framework\v2.0.50727\system.dll: could be
'System::ComponentModel::DefaultValueAttribute::DefaultValueAttribute(System::Object
^)'
d:\windows\microsoft.net\framework\v2.0.50727\system.dll: or
'System::ComponentModel::DefaultValueAttribute::DefaultValueAttribute(System::String
^)'
while trying to match the argument list '(nullptr)'
If I try to resolve this ambiguous call with safe_cast, dynamic_cast,
reinterpret_cast, static_cast or a C-style cast the compiler also reports an
error. In the beta version this cast was still allowed and worked correctly.
If I remove the DefaultValue property, then everything works fine, but the
designer will generate a nullptr assignment for every DbComboBox property.
Am I missing something or is a bug in the compiler?
Kind regards
S. Baumann
.
Relevant Pages
- Re: Text box throws an Error 7 Out of Memory with less than 27K in it!
... I'd have to agree with Bob here, ... >> those exact numbers and then concatenates that many more, ... I used to work supercomputer compiler support at CDC. ... > My favorite such bug at CDC was a benchmark that ran instantaneously. ... (microsoft.public.vb.enterprise) - Re: Bug in latest IAR MSP430 compiler optimization???
... It has been assigned bug id EW20095, and it will be fixed in the ... The tests compiler companies do are quite extensive. ... register allocation when combined with post-incs and rollup. ... IAR use an industry standard test suite like this (that you don't ... (comp.arch.embedded) - Re: Salford compiler: Assigning a value to a constant expression is invalid
... a bug, it is not usually wise, I think, to assume that it's a compiler bug. ... -|> I'd suggest submitting a self-contained source code file to Salford Support. ... So all I had to do in that case was send the routine and ... (comp.lang.fortran) - Re: Another computer algebra system : smib
... Certainly sometimes a bug is discovered only after a program is ported to a new environment -- a bug that existed in the old environment too, but just had not been exercised. ... Spending time porting a program is ... If the code is a command line drive program, then there should be few differences between for platform A and code for platform B. If one uses portable thread libraries, then if code breaks on platform B, but not on A, I would certainly think it is worth while spending time on platform B to find the problem, as it is highly likely to be a logical error in the program. ... The fact this is new code, I would not release it with over 1600 warnings messages from the compiler. ... (sci.math.symbolic) - Re: timeouts
... If I report a bug in the GCC C compiler, for example, then I can ... Stephen> a support contract for it. ... option when exclusively developing open source software. ... (comp.lang.ada) |
|