LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 13738 - MS compatibility: explicit specializations can be declared in any namespace
Summary: MS compatibility: explicit specializations can be declared in any namespace
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: 3.1
Hardware: PC Windows NT
: P enhancement
Assignee: Alexey Frolov
URL:
Keywords:
Depends on:
Blocks: 13707
  Show dependency tree
 
Reported: 2012-08-31 09:03 PDT by Martin Vejnár
Modified: 2015-03-20 03:48 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
patch for pr13738 (3.27 KB, patch)
2015-03-06 17:21 PST, Alexey Frolov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Vejnár 2012-08-31 09:03:56 PDT
vs10 will compile the following without errors, even when language extensions are disabled.

    namespace A {
        template <typename T>
        class X;
    }

    namespace B {
        template <>
        class A::X<int>;
    }

clang correctly outputs

    error: class template specialization of 'X' must originally be declared in namespace 'A'

The diagnostic should be suppressed when -fms-compatibility is in effect.
Comment 1 Martin Vejnár 2012-08-31 09:10:26 PDT
Patch (no tests): https://github.com/avakar/clang/commit/777e00420383fbeadedabf62635b02909925542a
Comment 2 Martin Vejnár 2012-08-31 09:11:37 PDT
(In reply to comment #1)
> Patch (no tests):
> https://github.com/avakar/clang/commit/777e00420383fbeadedabf62635b02909925542a

sorry, wrong bug
Comment 3 Alexey Frolov 2015-03-06 17:21:13 PST
Created attachment 13998 [details]
patch for pr13738
Comment 4 Alexey Frolov 2015-03-20 03:48:11 PDT
Fixed in r232800.