';'之前的预期类型说明符 代币

use*_*967 2 c++ inheritance class

我收到错误"'之前的预期类型说明符';' 令牌"在下面标记的代码行中.是否要求指定(*this)的类型?为什么编译器不知道(*this)的类型?

struct P{
};

struct R : public P{
  virtual P* copy(){
    return new(R(*this));  //error here
  }
};
Run Code Online (Sandbox Code Playgroud)

Ker*_* SB 6

你需要说:return new R(*this);这是非放置 - new表达的形式.没有额外的括号.