From: Ted Kremenek Date: Thu, 1 May 2008 18:32:59 +0000 (+0000) Subject: Added default ctor to Selector. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c65b8a3e1f8da6117a2b9ba57afe8b7a2ec887cc;p=clang Added default ctor to Selector. REASON: Without a default ctor we cannot do "new Selector[xxx]" and similar operations with ADTs that need to default constructor selectors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50534 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index 7c9efc8bc4..024ff14456 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -222,6 +222,10 @@ class Selector { public: friend class SelectorTable; // only the SelectorTable can create these. + /// The default ctor should only be used when creating data structures that + /// will contain selectors. + Selector() : InfoPtr(0) {} + IdentifierInfo *getAsIdentifierInfo() const { if (getIdentifierInfoFlag()) return reinterpret_cast(InfoPtr & ~ArgFlags);