[cfe-dev] clang issue with 'mutable' ?

David Blaikie dblaikie at gmail.com
Mon Oct 21 09:35:47 PDT 2013


Interestingly GCC ToT (g++-tot (GCC) 4.9.0 20130829 (experimental)) rejects
this the same way Clang does, but 4.8.1 does not (it accepts it).


On Mon, Oct 21, 2013 at 6:17 AM, Stefan Seefeld <stefan at seefeld.name> wrote:

> Hello,
>
> I have just run into an issue with some C++ code that I could reduce to
> this case:
>
>   template <typename T>
>   struct wrapper
>   {
>     wrapper() : member() {}
>     mutable T member;
>   };
>
>   int main()
>   {
>     wrapper<int const> w;
>   }
>
> clang would raise the error "'mutable' and 'const' cannot be mixed",
> while the same compiles (and works !) fine with g++.
>
> (Please note that the above may not look very meaningful, but in the
> original case I extracted this from it definitely does :-) )
>
> Could someone please confirm that this is a clang bug, or otherwise
> explain if it is indeed illegal C++ ?
>
> Many thanks,
>                 Stefan
>
>
> --
>
>       ...ich hab' noch einen Koffer in Berlin...
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131021/b9eabb7f/attachment.html>


More information about the cfe-dev mailing list