microsoft / microsoft/wil

wil::com_ptr typedef is silently omitted if WI_ENABLE_EXCEPTIONS isn't defined

Open
#109 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3k
Forks
300
Avg merge
19h 12m
Merged PRs (30d)
1

Description

If exceptions aren't enabled using wil::com_ptr results in an error that isn't immediately clear without digging through the source.
error C2039: 'com_ptr': is not a member of 'wil'
It should be pretty easy to add a struct that takes a compile time message and static_assert(false, message) if that class is instantiated to produce a clearer error message when using throwing types in binaries that don't support exceptions.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the wil::com_ptr definition and the WI_ENABLE_EXCEPTIONS conditional that omits it. Check the no-exceptions configuration and verify that using a throwing type produces a clear compile-time diagnostic instead of a missing-member error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.