Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Ensure CppBase::CreateInstance consumers are __CFRuntimeBase-derived.#1315

Merged
DHowett-MSFT merged 1 commit into
microsoft:developfrom
DHowett-MSFT:201611-cppbase-ii
Nov 4, 2016
Merged

Ensure CppBase::CreateInstance consumers are __CFRuntimeBase-derived.#1315
DHowett-MSFT merged 1 commit into
microsoft:developfrom
DHowett-MSFT:201611-cppbase-ii

Conversation

@DHowett-MSFT

@DHowett-MSFT DHowett-MSFT commented Nov 3, 2016

Copy link
Copy Markdown

This change is Reviewable

@DHowett-MSFT

Copy link
Copy Markdown
Author

Tested manually (since we cannot add compileable tests for it).

struct LOL {
};

struct CFEatMyShorts : CoreFoundation::CppBase<CFEatMyShorts, LOL> {
};

TEST(Shorts, EatingWorks) {
    CFEatMyShorts::CreateInstance();
} 

1>E:\src\WinObjC\Frameworks\include\CFCppBase.h(110,9): error : static_assert failed "CoreFoundation::CppBase cannot be used with types that do not derive from __CFRuntimeBase."
1>         E:\src\WinObjC\Frameworks\include\CFCppBase.h(134,16) :  note: in instantiation of function template specialization 'CoreFoundation::CppBase<CFEatMyShorts, LOL>::CreateInstance<>' requested here 

@DHowett-MSFT DHowett-MSFT merged commit 913b79a into microsoft:develop Nov 4, 2016
@DHowett-MSFT DHowett-MSFT deleted the 201611-cppbase-ii branch November 4, 2016 01:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants