Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

Friend declaration for sibling inner class causes warning

$
0
0

The following code causes a bogus warning:

 ~ > cat /tmp/main.cpp
template <typename T>
class Parent {
  class A {};
  class B {
    friend class Parent<T>::A;
  };
};
 ~ > icc -c /tmp/main.cpp
/tmp/main.cpp(5): warning #135: class template "Parent<T>" has no member "A"
      friend class Parent<T>::A;
                              ^

However it's perfectly legal C++ (AFAICT), and there are no warnings under either GCC 4.8.5 or Clang 3.7.0.


Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>