Skip to content

'this' is unavailable when entering constructor #42540

@SLTozer

Description

@SLTozer
Bugzilla Link 43195
Version trunk
OS Windows NT
Attachments File containing the reproducible case
CC @dwblaikie,@pogo59,@rnk

Extended Description

When building the attached file with clang-cl using the flags /Od /Zi and running the output with the Visual Studio 15 2017 debugger, evaluating this at line 8 (before initialization) gives the result "Variable is optimized away and not available.". This behaviour is different to both clang+lldb and pure MSVC, both of which give this the address of the uninitialized object. This occurs whether the MSVC linker or lld is used.

clang version 10.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions