Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F10991884
D29707.diff
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Dec 7, 3:59 AM
Size
1 KB
Mime Type
text/x-patch; charset=utf-8
Expires
Sun, Dec 8, 3:59 AM (1 d)
Engine
blob
Format
Raw Data
Handle
5847874
Attached To
D29707: Fix improper microsoft-pure-definition warning on template class
D29707.diff
View Options
Index: cfe/trunk/lib/Sema/SemaDecl.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp
+++ cfe/trunk/lib/Sema/SemaDecl.cpp
@@ -13244,7 +13244,7 @@
// MSVC permits the use of pure specifier (=0) on function definition,
// defined at class scope, warn about this non-standard construct.
- if (getLangOpts().MicrosoftExt && FD->isPure() && FD->isCanonicalDecl())
+ if (getLangOpts().MicrosoftExt && FD->isPure() && !FD->isOutOfLine())
Diag(FD->getLocation(), diag::ext_pure_function_definition);
if (!FD->isInvalidDecl()) {
Index: cfe/trunk/test/Parser/MicrosoftExtensions.cpp
===================================================================
--- cfe/trunk/test/Parser/MicrosoftExtensions.cpp
+++ cfe/trunk/test/Parser/MicrosoftExtensions.cpp
@@ -288,6 +288,18 @@
virtual ~pure_virtual_dtor_inline() = 0 { }// expected-warning {{function definition with pure-specifier is a Microsoft extension}}
};
+template<typename T> struct pure_virtual_dtor_template {
+ virtual ~pure_virtual_dtor_template() = 0;
+};
+template<typename T> pure_virtual_dtor_template<T>::~pure_virtual_dtor_template() {}
+template struct pure_virtual_dtor_template<int>;
+
+template<typename T> struct pure_virtual_dtor_template_inline {
+ virtual ~pure_virtual_dtor_template_inline() = 0 {}
+ // expected-warning@-1 2{{function definition with pure-specifier is a Microsoft extension}}
+};
+template struct pure_virtual_dtor_template_inline<int>;
+// expected-note@-1 {{in instantiation of member function}}
int main () {
// Necessary to force instantiation in -fdelayed-template-parsing mode.
Event Timeline
Log In to Comment