- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I'm encountering this warning:
w819test.cpp(8): warning #819: template nesting depth does not match the previous declaration of class template "A::B [with T1=int]"
friend class B;
^
detected during instantiation of class "A::B [with T1=int, T2=int]" at line 14
when compiling this little piece of code:
Has anybody an idea about the point of this waring?
It seems as if icpc complains about A::B not being the same as A::B. If so this warning is completetly
meaningless I would think. Anyway: is there a clean way of getting rid of it (except using -wd819)?
By the way: the warning vanishes if I change A into an non-template struct and g++ does not complain at all.
cathune
I'm encountering this warning:
w819test.cpp(8): warning #819: template nesting depth does not match the previous declaration of class template "A
friend class B;
^
detected during instantiation of class "A
when compiling this little piece of code:
[cpp]template< class T1 >
struct A
{
template< class T2 >
class B
{
template< class T3 >
friend class B;
};
};
int main()
{
A< int >::B< int > a;
return 0;
}
[/cpp]
Has anybody an idea about the point of this waring?
It seems as if icpc complains about A
meaningless I would think. Anyway: is there a clean way of getting rid of it (except using -wd819)?
By the way: the warning vanishes if I change A into an non-template struct and g++ does not complain at all.
cathune
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Cathune,
I have a question, why do you define friend class B is itself? If class B has itself friend class, how about template in calss B?
Thanks,
Wise
I have a question, why do you define friend class B is itself? If class B has itself friend class, how about template
Thanks,
Wise
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, this looks like a legitimate question. EDG*, which is the basis we use for our front-end, thought the C++ standard said something about friend template declarations needing to match the template parameter specification of the named entity. However, they are reviewing whether their initial interpretation is actually correct, and will get back to us. I've linked this thread to our internal problem report on this, and when we hear anything, I'll update the thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This warning no longer appears in the version 15.0 of the compiler now available with the Intel® Parallel Studio XE 2015 product line. Let us know if you need anything else.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page