Re: error : $S1 : modifiers not allowed ?!
- From: "Ben Voigt [C++ MVP]" <rbv@xxxxxxxxxxxxx>
- Date: Wed, 5 Mar 2008 08:34:56 -0600
"Mario Semo" <mario_semo@xxxxxxxxxxxx> wrote in message
news:uCVFfljfIHA.2000@xxxxxxxxxxxxxxxxxxxxxxx
Hello,
the following source code is not correct, but i cannot understand the
error message:
foo.cpp(20) : error C2270: '$S1' : modifiers not allowed on nonmember
functions
foo.cpp(20) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
what does this $S1 mean?
It's a bug, the compiler was obviously supposed to insert the name of the
function there, but didn't.
File a bug report on Connect.
Here is the sample:
======= foo.cpp ===========
class Foo;
class Bar
{
public:
operator Foo() const;
};
struct Foo;
typedef struct Foo
{
} Foo;
Bar::operator Foo() const
{
return Foo();
}
============================
cl -W4 -nologo foo.cpp
foo.cpp
foo.cpp(12) : warning C4099: 'Foo' : type name first seen using 'class'
now seen using 'struct'
foo.cpp(2) : see declaration of 'Foo'
foo.cpp(15) : warning C4099: 'Foo' : type name first seen using 'class'
now seen using 'struct'
foo.cpp(2) : see declaration of 'Foo'
foo.cpp(19) : error C2738: 'operator Foo' : is ambiguous or is not a
member of 'Bar'
foo.cpp(7) : see declaration of 'Bar'
foo.cpp(20) : error C2270: '$S1' : modifiers not allowed on nonmember
functions
foo.cpp(20) : error C4430: missing type specifier - int assumed. Note: C++
does not support default-int
foo.cpp(21) : error C2440: 'return' : cannot convert from 'Foo' to 'int'
No user-defined-conversion operator available that can perform this
conversion, or the operator cannot be called
foo.cpp(22) : error C2617: '$S1' : inconsistent return statement
foo.cpp(19) : see declaration of '$S1'
.
- Follow-Ups:
- Re: error : $S1 : modifiers not allowed ?!
- From: Mario Semo
- Re: error : $S1 : modifiers not allowed ?!
- References:
- error : $S1 : modifiers not allowed ?!
- From: Mario Semo
- error : $S1 : modifiers not allowed ?!
- Prev by Date: Re: difference in VC 6 and vc 2008 in "for block"
- Next by Date: Re: template -> instance -> function unresolved ???
- Previous by thread: Re: error : $S1 : modifiers not allowed ?!
- Next by thread: Re: error : $S1 : modifiers not allowed ?!
- Index(es):
Relevant Pages
|