Hi. I found strange behavior... Can I know about what's the `inline class`?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Hi. I found strange behavior... Can I know about what's the `inline class`?

Eonil Hoon Hwangbo
Hi. I discovered strange behavior. I'm using Clang 2.0 bundled within Xcode4.
I accidentally found that the Clang compiler allows :

    inline class AAA
    {
    };

in C++. Above code compiled successfully without any error.

I posted this question to a community ( http://stackoverflow.com/questions/5388097/whats-the-c-inline-class ) , and many people advised me to report this to this mailing list. They said this look like a bug.
Please let me know what's this.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Hi. I found strange behavior... Can I know about what's the `inline class`?

Eli Friedman
On Tue, Mar 22, 2011 at 8:57 PM, Eonil Hoon Hwangbo <[hidden email]> wrote:

> Hi. I discovered strange behavior. I'm using Clang 2.0 bundled within Xcode4.
> I accidentally found that the Clang compiler allows :
>
>    inline class AAA
>    {
>    };
>
> in C++. Above code compiled successfully without any error.
>
> I posted this question to a community ( http://stackoverflow.com/questions/5388097/whats-the-c-inline-class ) , and many people advised me to report this to this mailing list. They said this look like a bug.
> Please let me know what's this.

It's a bug; see http://llvm.org/bugs/show_bug.cgi?id=3941 .

-Eli

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Hi. I found strange behavior... Can I know about what's the `inline class`?

Chris Lattner

On Mar 22, 2011, at 9:33 PM, Eli Friedman wrote:

> On Tue, Mar 22, 2011 at 8:57 PM, Eonil Hoon Hwangbo <[hidden email]> wrote:
>> Hi. I discovered strange behavior. I'm using Clang 2.0 bundled within Xcode4.
>> I accidentally found that the Clang compiler allows :
>>
>>    inline class AAA
>>    {
>>    };
>>
>> in C++. Above code compiled successfully without any error.
>>
>> I posted this question to a community ( http://stackoverflow.com/questions/5388097/whats-the-c-inline-class ) , and many people advised me to report this to this mailing list. They said this look like a bug.
>> Please let me know what's this.
>
> It's a bug; see http://llvm.org/bugs/show_bug.cgi?id=3941 .

It turns out that John just implemented this in r128118:

t.cc:2:1: warning: 'inline' ignored on this declaration
inline class AAA
^
1 warning generated.


It's not clear to me why this is just a warning though.  John?

-Chris
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Hi. I found strange behavior... Can I know about what's the `inline class`?

John McCall

On Mar 22, 2011, at 9:58 PM, Chris Lattner wrote:

>
> On Mar 22, 2011, at 9:33 PM, Eli Friedman wrote:
>
>> On Tue, Mar 22, 2011 at 8:57 PM, Eonil Hoon Hwangbo <[hidden email]> wrote:
>>> Hi. I discovered strange behavior. I'm using Clang 2.0 bundled within Xcode4.
>>> I accidentally found that the Clang compiler allows :
>>>
>>>   inline class AAA
>>>   {
>>>   };
>>>
>>> in C++. Above code compiled successfully without any error.
>>>
>>> I posted this question to a community ( http://stackoverflow.com/questions/5388097/whats-the-c-inline-class ) , and many people advised me to report this to this mailing list. They said this look like a bug.
>>> Please let me know what's this.
>>
>> It's a bug; see http://llvm.org/bugs/show_bug.cgi?id=3941 .
>
> It turns out that John just implemented this in r128118:
>
> t.cc:2:1: warning: 'inline' ignored on this declaration
> inline class AAA
> ^
> 1 warning generated.
>
>
> It's not clear to me why this is just a warning though.  John?

I wanted to float it for a bit before making it an error.  It could be an error, though.

John.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev