Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem using incomplete types and std::is_base_of

Johnny WillemsenMar 1 2016 — edited Mar 9 2016

We see that our code doesn't compile with the new 12.5 with C++11 enabled. The code below does compile with gcc but not with suncc 12.5 with -std=c++11. The example is coming from the GCC bugzilla, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50732 Is this a bug in the compiler?

#include <iostream>

#include <type_traits>

template <typename T>

struct non_instantiatable

{

typedef typename T::THIS_TYPE_CANNOT_BE_INSTANTIATED type;

};

int main (int argc, char* argv[])

{

std::cout << std::is_base_of<non_instantiatable<int>, void>::value << std::endl;

 

return 0;

  }

This post has been answered by Steve.Clamage-Oracle on Mar 3 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 6 2016
Added on Mar 1 2016
2 comments
1,233 views