Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Ctors are not simulated properly #96

Open
Xazax-hun opened this issue Dec 20, 2020 · 5 comments
Open

Ctors are not simulated properly #96

Xazax-hun opened this issue Dec 20, 2020 · 5 comments

Comments

@Xazax-hun
Copy link
Collaborator

See missing warning here: https://godbolt.org/z/1715PY

@mgehre
Copy link
Owner

mgehre commented Dec 21, 2020

Merry christmas, @Xazax-hun :-)

@mgehre
Copy link
Owner

mgehre commented Dec 21, 2020

I wonder where the cast to const void* comes from in

  | | | | | | | `-ImplicitCastExpr <col:33, col:40> 'const void *' <BitCast>
  | | | | | | |   `-CXXMemberCallExpr <col:33, col:40> 'int *'
  | | | | | | |     `-MemberExpr <col:33, col:35> '<bound member function type>' .data 0x5576782dc2d0
  | | | | | | |       `-DeclRefExpr <col:33> 'std::vector<int, allocator<int> >':'std::vector<int, std::allocator<int> >' lvalue Var 0x5576782bc9a8 'V' 'std::vector<int, allocator<int> >':'std::vector<int, std::allocator<int> >'

Is it because that's the only overload on the operator<< that is viable here?

@Xazax-hun
Copy link
Collaborator Author

Xazax-hun commented Dec 21, 2020

Oh, merry christmas @mgehre :)

Feel free to ignore this for now, I just wanted to note this down so we don't forget dealing with it later. I have no idea where that cast is coming from. I'd also like to know if you manage to figure out :)

@mgehre
Copy link
Owner

mgehre commented Dec 21, 2020

I think it's because const void* is the only overload that can take pointers, see https://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt

@Xazax-hun
Copy link
Collaborator Author

Oh, indeed. I somehow skipped the rest of the text after the dump. This makes sense to me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants