⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ptrmem6.c

📁 linux下的gcc编译器
💻 C
字号:
// { dg-do compile }// Origin: <togawa at acm dot arg>// c++/2094: unsupported 'ptrmem_cst' in type unificationstruct R{   int i;};struct S{   int i;   int j;};struct S2 : S{};template<int S::*p, typename>struct X{    X ();    template<typename U> X(const X<p,U> &);};X<&S::i,S> x  = X<&S::i,S>();X<&S::i,S> x2 = X<&S2::i,S>();X<&S::i,S> y  = X<&S::j,S>();  // { dg-error "" }X<&S::i,S> z  = X<&R::i,S>();  // { dg-error "" }template <class T>struct Foo{  void foo(void)  {     X<&T::i,T> x  = X<&T::i,T>();     X<&S::i,S> x2 = X<&S2::i,S>();     X<&S::i,S> y  = X<&S::j,S>(); // { dg-error "" }     X<&S::i,S> z  = X<&R::i,S>(); // { dg-error "" }  }};template struct Foo<S>;  // { dg-error "instantiated from" }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -