- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When a nested private template class is specialized outside the declaration of the parent class, the intel compiler issues an error #308. clang and vc110 compile the same code.
If I make the same nested template class public, the intel compiler compiles it as well.
That doesn't make sense to me: You wouldn't want to declare a nested template class public just because you want to specialize it outside, right? Is this a known issue?
I have Intel Composer 2013, Version 13.1.3.198 Build 20130607.
(If necessary, I can make a toy example.)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
//-----------------------------------------------------
template<class T>
struct A {
private:
template<class U> struct B
{
static int v() { return 0; }
};
public:
template<class U>
static int foo()
{
return B<U>::v();
}
};
template<class T> template<class U>
struct A<T>::B<U*>
{
static int v() { return 1; }
};
#include <iostream>
int main()
{
std::cout << A<int>::foo<int*>() << std::endl;
}
This leads to
error #308: class template "A<T>::B [with T=int]" (declared at line 5) is inaccessible
1> struct A<T>::B<U*>
1> ^
1> detected during instantiation of class "A<T> [with T=int]" at line 27
1>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the small test case. This does indeed look like a bug, I have entered it into our bug tracking database as DPD200248044.
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you. Could I get a link to that database, please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, but due to privacy concerns only Intel employees can access the database. We will keep you posted when it is fixed.
thanks, Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh ok. I get the ID but all getters are private. Can't be helped. :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Any update on issue DPD200248044?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the newest Composer XE2013 SP1 update 3 from last week, this issue persists. Can you give me an estimation when this will be fixed?
This is kind of a show-stopper for us for actually using the Intel Compiler because we have a third-party header-only template library where the code pattern in the example is used everywhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Weibke,
We have worked out a fix in the next update ,which would be released until the end of July .
However ,there is a simple workaround -- you can declare the nested class public instead of private.
If you need to do this is lots of places and/or don’t want to touch third party code I think you could just put –Dprivate=public on the command line to change ALL private members to public members. It probably wouldn’t be good to do this when your code is under development but if all you are trying to do is get some code to build with our compiler for performance testing purposes then that should work.
Thank you.
--
QIAOMIN.Q
Intel Developer Support
Please participate in our redesigned community support web site:
User forums: http://software.intel.com/en-us/forums/
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page