我有这个 .h 文件:
namespace{
class Invariant{
public:
Invariant(z3::expr e,Instruction *i):Expr(e),I(i){
DenseMap<Instruction*,Invariant*> FunMap = Invariants[F];
}
private:
//static map
static DenseMap<Function*, DenseMap<Instruction*,Invariant*> >Invariants;
};
}//end of anonymous namespace
当我编译clang时说:
Invariant.h:46:65: warning: variable '<anonymous namespace>::Invariant::Invariants' has internal linkage but is not defined
static DenseMap<Function*, DenseMap<Instruction*,Invariant*> >Invariants;
^
Invariant.h:26:48: note: used here
DenseMap<Instruction*,Invariant*> FunMap = Invariants[F];
这里有什么问题?