diff --git a/cpp/include/Ice/StreamHelpers.h b/cpp/include/Ice/StreamHelpers.h index 577ef2e6f6e..73ed787a417 100644 --- a/cpp/include/Ice/StreamHelpers.h +++ b/cpp/include/Ice/StreamHelpers.h @@ -30,20 +30,18 @@ const StreamHelperCategory StreamHelperCategoryBuiltinValue = 1; const StreamHelperCategory StreamHelperCategoryBuiltin = 2; /** For struct types. */ const StreamHelperCategory StreamHelperCategoryStruct = 3; -/** For struct types with cpp:class metadata. */ -const StreamHelperCategory StreamHelperCategoryStructClass = 4; /** For enum types. */ -const StreamHelperCategory StreamHelperCategoryEnum = 5; +const StreamHelperCategory StreamHelperCategoryEnum = 4; /** For sequence types. */ -const StreamHelperCategory StreamHelperCategorySequence = 6; +const StreamHelperCategory StreamHelperCategorySequence = 5; /** For dictionary types. */ -const StreamHelperCategory StreamHelperCategoryDictionary = 7; +const StreamHelperCategory StreamHelperCategoryDictionary = 6; /** For proxy types. */ -const StreamHelperCategory StreamHelperCategoryProxy = 8; +const StreamHelperCategory StreamHelperCategoryProxy = 7; /** For class types. */ -const StreamHelperCategory StreamHelperCategoryClass = 9; +const StreamHelperCategory StreamHelperCategoryClass = 8; /** For exception types. */ -const StreamHelperCategory StreamHelperCategoryUserException = 10; +const StreamHelperCategory StreamHelperCategoryUserException = 9; /** * The optional format. @@ -432,7 +430,7 @@ struct StreamHelper }; // -// "helpers" for the StreamHelper below +// "helpers" for the StreamHelper below // slice2cpp generates specializations as needed // @@ -482,27 +480,6 @@ struct StreamHelper } }; -/** - * Helper for class structs. - * \headerfile Ice/Ice.h - */ -template -struct StreamHelper -{ - template static inline void - write(S* stream, const T& v) - { - StreamWriter::write(stream, v); - } - - template static inline void - read(S* stream, T& v) - { - v = new typename T::element_type; - StreamReader::read(stream, v); - } -}; - /** * Helper for enums. * \headerfile Ice/Ice.h @@ -845,15 +822,6 @@ struct StreamOptionalHelper } }; -/** - * Class structs are encoded like structs. - * \headerfile Ice/Ice.h - */ -template -struct StreamOptionalHelper : StreamOptionalHelper -{ -}; - // InputStream and OutputStream have special logic for optional (tagged) proxies that does not rely on the // StreamOptional helpers. diff --git a/cpp/src/slice2cpp/CPlusPlusUtil.cpp b/cpp/src/slice2cpp/CPlusPlusUtil.cpp index 93487a6245d..4ff29db96f1 100644 --- a/cpp/src/slice2cpp/CPlusPlusUtil.cpp +++ b/cpp/src/slice2cpp/CPlusPlusUtil.cpp @@ -111,29 +111,6 @@ sequenceTypeToString(const SequencePtr& seq, const string& scope, const StringLi typeCtx | (inWstringModule(seq) ? TypeContextUseWstring : 0)); return "::std::pair"; } - else if(seqType.find("%range") == 0) - { - string s; - if(seqType.find("%range:") == 0) - { - s = seqType.substr(strlen("%range:")); - } - else - { - s = getUnqualified(fixKwd(seq->scoped()), scope); - } - - if(typeCtx & TypeContextAMIPrivateEnd) - { - return s; - } - - if(s[0] == ':') - { - s = " " + s; - } - return "::std::pair<" + s + "::const_iterator, " + s + "::const_iterator>"; - } else { return seqType; @@ -172,8 +149,7 @@ writeParamAllocateCode(Output& out, const TypePtr& type, bool optional, const st } // - // If using a range or array we need to allocate the range container, or - // array as well now to ensure they are always in the same scope. + // If using a array we need to allocate the array as well now to ensure they are always in the same scope. // SequencePtr seq = dynamic_pointer_cast(type); if(seq) @@ -189,15 +165,6 @@ writeParamAllocateCode(Output& out, const TypePtr& type, bool optional, const st { str = typeToString(seq, scope, metaData, TypeContextAMIPrivateEnd); } - else if(seqType.find("%range") == 0) - { - StringList md; - if(seqType.find("%range:") == 0) - { - md.push_back("cpp:type:" + seqType.substr(strlen("%range:"))); - } - str = typeToString(seq, scope, md, 0); - } if(!str.empty()) { @@ -285,23 +252,6 @@ writeParamEndCode(Output& out, const TypePtr& type, bool optional, const string& } } } - else if(seqType.find("%range") == 0) - { - if(optional) - { - out << nl << "if(" << escapedParamName << ")"; - out << sb; - out << nl << paramName << ".emplace();"; - out << nl << paramName << "->first = (*" << escapedParamName << ").begin();"; - out << nl << paramName << "->second = (*" << escapedParamName << ").end();"; - out << eb; - } - else - { - out << nl << paramName << ".first = " << escapedParamName << ".begin();"; - out << nl << paramName << ".second = " << escapedParamName << ".end();"; - } - } } } @@ -720,17 +670,7 @@ Slice::typeToString(const TypePtr& type, const string& scope, const StringList& StructPtr st = dynamic_pointer_cast(type); if(st) { - // - // C++11 mapping doesn't accept cpp:class metadata - // - if(!cpp11 && findMetaData(st->getMetaData()) == "%class") - { - return getUnqualified(fixKwd(st->scoped() + "Ptr"), scope); - } - else - { - return getUnqualified(fixKwd(st->scoped()), scope); - } + return getUnqualified(fixKwd(st->scoped()), scope); } InterfaceDeclPtr proxy = dynamic_pointer_cast(type); @@ -855,21 +795,7 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const string& scope StructPtr st = dynamic_pointer_cast(type); if(st) { - if(cpp11) - { - return "const " + getUnqualified(fixKwd(st->scoped()), scope) + "&"; - } - else - { - if(findMetaData(st->getMetaData()) == "%class") - { - return "const " + getUnqualified(fixKwd(st->scoped() + "Ptr"), scope) + "&"; - } - else - { - return "const " + getUnqualified(fixKwd(st->scoped()), scope) + "&"; - } - } + return "const " + getUnqualified(fixKwd(st->scoped()), scope) + "&"; } InterfaceDeclPtr proxy = dynamic_pointer_cast(type); @@ -961,14 +887,7 @@ Slice::outputTypeToString(const TypePtr& type, bool optional, const string& scop StructPtr st = dynamic_pointer_cast(type); if(st) { - if(!cpp11 && findMetaData(st->getMetaData()) == "%class") - { - return getUnqualified(fixKwd(st->scoped() + "Ptr&"), scope); - } - else - { - return getUnqualified(fixKwd(st->scoped()), scope) + "&"; - } + return getUnqualified(fixKwd(st->scoped()), scope) + "&"; } InterfaceDeclPtr proxy = dynamic_pointer_cast(type); @@ -1167,12 +1086,6 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, bool optional writeParamEndCode(out, seq, optional, param, metaData, obj); return; } - else if(seqType.find("%range") == 0) - { - out << nl << func << objPrefix << param << "_tmp_);"; - writeParamEndCode(out, seq, optional, param, metaData, obj); - return; - } } } @@ -1247,15 +1160,6 @@ Slice::getEndArg(const TypePtr& type, const StringList& metaData, const string& endArg += "_tmp_"; } } - else if(seqType.find("%range") == 0) - { - StringList md; - if(seqType.find("%range:") == 0) - { - md.push_back("cpp:type:" + seqType.substr(strlen("%range:"))); - } - endArg += "_tmp_"; - } } return endArg; } @@ -1332,7 +1236,6 @@ Slice::writeStreamHelpers(Output& out, const ContainedPtr& c, DataMemberList dataMembers, bool hasBaseDataMembers, - bool checkClassMetaData, bool cpp11) { // If c is a C++11 class/exception whose base class contains data members (recursively), then we need to generate @@ -1371,9 +1274,8 @@ Slice::writeStreamHelpers(Output& out, optionalMembers.sort(SortFn::compare); string scoped = c->scoped(); - bool classMetaData = checkClassMetaData ? (findMetaData(c->getMetaData(), false) == "%class") : false; - string fullName = classMetaData ? fixKwd(scoped + "Ptr") : fixKwd(scoped); - string holder = classMetaData ? "v->" : "v."; + string fullName = fixKwd(scoped); + string holder = "v."; // // Generate StreamWriter @@ -1535,12 +1437,11 @@ Slice::findMetaData(const StringList& metaData, int typeCtx) // is returned. // If the form is cpp:view-type:<...> the data after the // cpp:view-type: is returned - // If the form is cpp:range[:<...>], cpp:array or cpp:class, - // the return value is % followed by the string after cpp:. + // If the form is cpp:array, the return value is % followed by the string after cpp:. // // The priority of the metadata is as follows: - // 1: array, range (C++98 only), view-type for "view" parameters - // 2: class (C++98 only), scoped (C++98 only), unscoped (C++11 only) + // 1: array view-type for "view" parameters + // 2: unscoped // if(pos != string::npos) @@ -1553,10 +1454,6 @@ Slice::findMetaData(const StringList& metaData, int typeCtx) { return str.substr(pos + 1); } - else if(ss.find("range:") == 0 && !(typeCtx & TypeContextCpp11)) - { - return string("%") + str.substr(prefix.size()); - } } if(ss.find("type:") == 0) @@ -1571,26 +1468,14 @@ Slice::findMetaData(const StringList& metaData, int typeCtx) { return "%array"; } - else if(ss == "range" && !(typeCtx & TypeContextCpp11)) - { - return "%range"; - } } // - // Otherwise if the data is "class", "scoped" or "unscoped" it is returned. + // Otherwise if the data is "unscoped" it is returned. // else { string ss = str.substr(prefix.size()); - if(ss == "class" && !(typeCtx & TypeContextCpp11)) - { - return "%class"; - } - else if(ss == "scoped" && !(typeCtx & TypeContextCpp11)) - { - return "%scoped"; - } - else if(ss == "unscoped" && (typeCtx & TypeContextCpp11)) + if(ss == "unscoped" && (typeCtx & TypeContextCpp11)) { return "%unscoped"; } diff --git a/cpp/src/slice2cpp/CPlusPlusUtil.h b/cpp/src/slice2cpp/CPlusPlusUtil.h index 171f732bc28..0b5791a6dde 100644 --- a/cpp/src/slice2cpp/CPlusPlusUtil.h +++ b/cpp/src/slice2cpp/CPlusPlusUtil.h @@ -58,7 +58,7 @@ std::string getEndArg(const TypePtr&, const StringList&, const std::string&); void writeEndCode(::IceUtilInternal::Output&, const ParamDeclList&, const OperationPtr&, bool = false); void writeMarshalUnmarshalDataMemberInHolder(IceUtilInternal::Output&, const std::string&, const DataMemberPtr&, bool); void writeMarshalUnmarshalAllInHolder(IceUtilInternal::Output&, const std::string&, const DataMemberList&, bool, bool); -void writeStreamHelpers(::IceUtilInternal::Output&, const ContainedPtr&, DataMemberList, bool, bool, bool); +void writeStreamHelpers(::IceUtilInternal::Output&, const ContainedPtr&, DataMemberList, bool, bool); void writeIceTuple(::IceUtilInternal::Output&, DataMemberList, int); bool findMetaData(const std::string&, const ClassDeclPtr&, std::string&); diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 1b390c0aa05..b464dbf9e05 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -143,8 +143,7 @@ writeConstantValue(IceUtilInternal::Output& out, const TypePtr& type, const Synt EnumeratorPtr enumerator = dynamic_pointer_cast(valueType); assert(enumerator); - bool unscoped = (cpp11 && findMetaData(ep->getMetaData(), TypeContextCpp11) == "%unscoped") || - (!cpp11 && findMetaData(ep->getMetaData()) != "%scoped"); + bool unscoped = (cpp11 && findMetaData(ep->getMetaData(), TypeContextCpp11) == "%unscoped"); if(unscoped) { @@ -823,8 +822,6 @@ Slice::Gen::generate(const UnitPtr& p) } { - normalizeMetaData(p, true); - ForwardDeclVisitor forwardDeclVisitor(H); p->visit(&forwardDeclVisitor, false); @@ -895,7 +892,6 @@ Slice::Gen::MetaDataVisitor::visitUnitStart(const UnitPtr& p) // // Validate file metadata in the top-level file and all included files. - // Note that these metadata can only be cpp:, never cpp98: or cpp11: // StringList files = p->allFiles(); @@ -1070,8 +1066,7 @@ Slice::Gen::MetaDataVisitor::visitOperation(const OperationPtr& p) for(StringList::const_iterator q = metaData.begin(); q != metaData.end();) { string s = *q++; - if(s.find("cpp:type:") == 0 || s.find("cpp:view-type:") == 0 || - s.find("cpp:range") == 0 || s == "cpp:array") + if(s.find("cpp:type:") == 0 || s.find("cpp:view-type:") == 0 || s == "cpp:array") { dc->warning(InvalidMetaData, p->file(), p->line(), "ignoring invalid metadata `" + s + "' for operation with void return type"); @@ -1134,8 +1129,6 @@ Slice::Gen::MetaDataVisitor::validate(const SyntaxTreeBasePtr& cont, const Strin const string& file, const string& line, bool operation) { static const string cppPrefix = "cpp:"; - static const string cpp11Prefix = "cpp11:"; - static const string cpp98Prefix = "cpp98:"; const UnitPtr ut = cont->unit(); const DefinitionContextPtr dc = ut->findDefinitionContext(file); @@ -1145,23 +1138,18 @@ Slice::Gen::MetaDataVisitor::validate(const SyntaxTreeBasePtr& cont, const Strin { string s = *p++; - string prefix; - bool cpp98 = false; - bool cpp11 = false; - - if(s.find(cppPrefix) == 0) - { - prefix = cppPrefix; - } - else if(s.find(cpp98Prefix) == 0) + // Issue friendly warning for cpp11 and cpp98 metadata what were removed as Slice does not issue warnings + // for unknown "top-level" metadata. + if (s.find("cpp11:") == 0 || s.find("cpp98:") == 0) { - prefix = cpp98Prefix; - cpp98 = true; + dc->warning(InvalidMetaData, file, line, "ignoring invalid metadata `" + s + "'"); + newMetaData.remove(s); + continue; } - else if(s.find(cpp11Prefix) == 0) + + if(s.find(cppPrefix) != 0) { - prefix = cpp11Prefix; - cpp11 = true; + continue; } if(operation && (s == "cpp:const" || s == "cpp:noexcept")) @@ -1169,320 +1157,59 @@ Slice::Gen::MetaDataVisitor::validate(const SyntaxTreeBasePtr& cont, const Strin continue; } - if(!prefix.empty()) + string ss = s.substr(cppPrefix.size()); + if(ss == "type:wstring" || ss == "type:string") { - string ss = s.substr(prefix.size()); - if(ss == "type:wstring" || ss == "type:string") - { - BuiltinPtr builtin = dynamic_pointer_cast(cont); - ModulePtr module = dynamic_pointer_cast(cont); - ClassDefPtr clss = dynamic_pointer_cast(cont); - InterfaceDefPtr interface = dynamic_pointer_cast(cont); - StructPtr strct = dynamic_pointer_cast(cont); - ExceptionPtr exception = dynamic_pointer_cast(cont); - if((builtin && builtin->kind() == Builtin::KindString) || module || clss || strct || interface || exception) - { - continue; - } - } - if(dynamic_pointer_cast(cont) && (ss.find("type:") == 0 || ss.find("view-type:") == 0)) - { - if(dynamic_pointer_cast(cont)->kind() == Builtin::KindString) - { - continue; - } - } - if(dynamic_pointer_cast(cont)) - { - if(ss.find("type:") == 0 || ss.find("view-type:") == 0 || ss == "array" || ss.find("range") == 0) - { - continue; - } - } - if(dynamic_pointer_cast(cont) && (ss.find("type:") == 0 || ss.find("view-type:") == 0)) + BuiltinPtr builtin = dynamic_pointer_cast(cont); + ModulePtr module = dynamic_pointer_cast(cont); + ClassDefPtr clss = dynamic_pointer_cast(cont); + InterfaceDefPtr interface = dynamic_pointer_cast(cont); + StructPtr strct = dynamic_pointer_cast(cont); + ExceptionPtr exception = dynamic_pointer_cast(cont); + if((builtin && builtin->kind() == Builtin::KindString) || module || clss || strct || interface || exception) { continue; } - if(!cpp11 && dynamic_pointer_cast(cont) && (ss == "class" || ss == "comparable")) - { - continue; - } - - if(dynamic_pointer_cast(cont) && ss == "ice_print") - { - continue; - } - if(!cpp11 && dynamic_pointer_cast(cont) && ss == "scoped") + } + if(dynamic_pointer_cast(cont) && (ss.find("type:") == 0 || ss.find("view-type:") == 0)) + { + if(dynamic_pointer_cast(cont)->kind() == Builtin::KindString) { continue; } - if(!cpp98 && dynamic_pointer_cast(cont) && ss == "unscoped") + } + if(dynamic_pointer_cast(cont)) + { + if(ss.find("type:") == 0 || ss.find("view-type:") == 0 || ss == "array") { continue; } - - { - ClassDeclPtr cl = dynamic_pointer_cast(cont); - if(cl && ss.find("type:") == 0) - { - continue; - } - } - - dc->warning(InvalidMetaData, file, line, "ignoring invalid metadata `" + s + "'"); - newMetaData.remove(s); - continue; } - - if(s.find("delegate") == 0) + if(dynamic_pointer_cast(cont) && (ss.find("type:") == 0 || ss.find("view-type:") == 0)) { - dc->warning(InvalidMetaData, file, line, "ignoring invalid metadata `" + s + "'"); - newMetaData.remove(s); continue; } - } - return newMetaData; -} - -void -Slice::Gen::normalizeMetaData(const UnitPtr& u, bool cpp11) -{ - NormalizeMetaDataVisitor visitor(cpp11); - u->visit(&visitor, false); -} - -Slice::Gen::NormalizeMetaDataVisitor::NormalizeMetaDataVisitor(bool cpp11) : - _cpp11(cpp11) -{ -} - -bool -Slice::Gen::NormalizeMetaDataVisitor::visitUnitStart(const UnitPtr&) -{ - return true; -} - -bool -Slice::Gen::NormalizeMetaDataVisitor::visitModuleStart(const ModulePtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); - return true; -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitModuleEnd(const ModulePtr&) -{ -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitClassDecl(const ClassDeclPtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); -} - -bool -Slice::Gen::NormalizeMetaDataVisitor::visitClassDefStart(const ClassDefPtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); - return true; -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitClassDefEnd(const ClassDefPtr&) -{ -} - -bool -Slice::Gen::NormalizeMetaDataVisitor::visitExceptionStart(const ExceptionPtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); - return true; -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitExceptionEnd(const ExceptionPtr&) -{ -} - -bool -Slice::Gen::NormalizeMetaDataVisitor::visitStructStart(const StructPtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); - return true; -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitStructEnd(const StructPtr&) -{ -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitOperation(const OperationPtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); - - ParamDeclList params = p->parameters(); - for(ParamDeclList::iterator q = params.begin(); q != params.end(); ++q) - { - (*q)->setMetaData(normalize((*q)->getMetaData())); - } -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitDataMember(const DataMemberPtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitSequence(const SequencePtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitDictionary(const DictionaryPtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitEnum(const EnumPtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); -} - -void -Slice::Gen::NormalizeMetaDataVisitor::visitConst(const ConstPtr& p) -{ - p->setMetaData(normalize(p->getMetaData())); -} - -StringList -Slice::Gen::NormalizeMetaDataVisitor::normalize(const StringList& metaData) -{ - // - // if _cpp11: transform "cpp:" into "cpp-all:" and "cpp" - // + transform "cpp11:" into "cpp:" in front - // - // if !_cpp11: remove "cpp:", transform "cpp-all:" into "cpp" - // + transform "cpp98:" into "cpp:" in front - - // - // Note: file metadata like header-ext exists only in cpp: - // form and are not processed at all - // - - StringList result; - - static const string cppPrefixTable[] = - { - "array", - "class", - "comparable", - "const", - "ice_print", - "range", - "scoped", - "type:", - "unscoped", - "view-type:", - "" - }; - - static const string cppPrefix = "cpp:"; - static const string cppAllPrefix = "cpp-all:"; - - // - // First look for the higher priority cpp98/cpp11, that go to the - // front of result - // - - static const string cpp11Prefix = "cpp11:"; - static const string cpp98Prefix = "cpp98:"; - - const string altCppPrefix = _cpp11 ? cpp11Prefix : cpp98Prefix; - - for(StringList::const_iterator p = metaData.begin(); p != metaData.end(); ++p) - { - string s = *p; - - unsigned int i = 0; - bool found = false; - while(!found) + if(dynamic_pointer_cast(cont) && ss == "ice_print") { - string m = cppPrefixTable[i++]; - if(m.empty()) - { - break; - } - if(s.find(altCppPrefix + m) == 0) - { - found = true; - } + continue; } - - if(found) + if(dynamic_pointer_cast(cont) && ss == "unscoped") { - s.replace(0, altCppPrefix.length(), cppPrefix); - result.push_back(s); + continue; } - } - - // - // Then look for the lower-priority "cpp:" / "cpp-all:", pushed back later - // - - const string prefix = _cpp11 ? cppPrefix : cppAllPrefix; - - for(StringList::const_iterator p = metaData.begin(); p != metaData.end(); ++p) - { - string s = *p; - unsigned int i = 0; - bool foundPrefix = false; - bool foundOld = false; - while(!foundPrefix && !foundOld) { - string m = cppPrefixTable[i++]; - if(m.empty()) - { - break; // while - } - if(s.find(prefix + m) == 0) + ClassDeclPtr cl = dynamic_pointer_cast(cont); + if(cl && ss.find("type:") == 0) { - foundPrefix = true; - } - else if(!_cpp11 && s.find(cppPrefix + m) == 0) - { - // - // We want to filter-out "cpp:" when !_cpp11 - // - foundOld = true; + continue; } } - if(foundPrefix) - { - if(_cpp11) - { - result.push_back(s); - s.replace(0, prefix.length(), cppAllPrefix); - result.push_back(s); - } - else - { - s.replace(0, prefix.length(), cppPrefix); - result.push_back(s); - } - } - else if(_cpp11 || !foundOld) - { - result.push_back(s); - } + dc->warning(InvalidMetaData, file, line, "ignoring invalid metadata `" + s + "'"); + newMetaData.remove(s); } - - return result; + return newMetaData; } int @@ -2311,7 +2038,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) // // Generate a read method if there are more than one ret/out parameter. If there's // only one, we rely on the default read method from LambdaOutgoing - // except if the unique ret/out is optional or is an array/range. + // except if the unique ret/out is optional or is an array. // C << "," << nl << "[](" << getUnqualified("::Ice::InputStream*", interfaceScope) << " istr)"; C << sb; @@ -3675,7 +3402,7 @@ Slice::Gen::StreamVisitor::visitStructStart(const StructPtr& p) H << nl << "static const bool fixedLength = " << (p->isVariableLength() ? "false" : "true") << ";"; H << eb << ";" << nl; - writeStreamHelpers(H, p, p->dataMembers(), false, false, true); + writeStreamHelpers(H, p, p->dataMembers(), false, true); return false; } @@ -3683,7 +3410,7 @@ Slice::Gen::StreamVisitor::visitStructStart(const StructPtr& p) bool Slice::Gen::StreamVisitor::visitClassDefStart(const ClassDefPtr& c) { - writeStreamHelpers(H, c, c->dataMembers(), c->hasBaseDataMembers(), true, true); + writeStreamHelpers(H, c, c->dataMembers(), c->hasBaseDataMembers(), true); return false; } @@ -3696,7 +3423,7 @@ Slice::Gen::StreamVisitor::visitExceptionStart(const ExceptionPtr&) void Slice::Gen::StreamVisitor::visitExceptionEnd(const ExceptionPtr& p) { - writeStreamHelpers(H, p, p->dataMembers(), p->hasBaseDataMembers(), true, true); + writeStreamHelpers(H, p, p->dataMembers(), p->hasBaseDataMembers(), true); } void diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h index bffc74efa7a..b037f89a3be 100644 --- a/cpp/src/slice2cpp/Gen.h +++ b/cpp/src/slice2cpp/Gen.h @@ -244,38 +244,7 @@ class Gen bool = false); }; - class NormalizeMetaDataVisitor final : public ParserVisitor - { - public: - - NormalizeMetaDataVisitor(bool); - - bool visitUnitStart(const UnitPtr&) final; - bool visitModuleStart(const ModulePtr&) final; - void visitModuleEnd(const ModulePtr&) final; - void visitClassDecl(const ClassDeclPtr&) final; - bool visitClassDefStart(const ClassDefPtr&) final; - void visitClassDefEnd(const ClassDefPtr&) final; - bool visitExceptionStart(const ExceptionPtr&) final; - void visitExceptionEnd(const ExceptionPtr&) final; - bool visitStructStart(const StructPtr&) final; - void visitStructEnd(const StructPtr&) final; - void visitOperation(const OperationPtr&) final; - void visitDataMember(const DataMemberPtr&) final; - void visitSequence(const SequencePtr&) final; - void visitDictionary(const DictionaryPtr&) final; - void visitEnum(const EnumPtr&) final; - void visitConst(const ConstPtr&) final; - - private: - - StringList normalize(const StringList&); - - bool _cpp11; - }; - static void validateMetaData(const UnitPtr&); - static void normalizeMetaData(const UnitPtr&, bool); }; } diff --git a/cpp/test/Ice/custom/AllTests.cpp b/cpp/test/Ice/custom/AllTests.cpp index e63d11fd49d..4972726a5c4 100644 --- a/cpp/test/Ice/custom/AllTests.cpp +++ b/cpp/test/Ice/custom/AllTests.cpp @@ -148,89 +148,6 @@ allTests(Test::TestHelper* helper) test(ret == in); } - { - Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - Test::BoolSeq out; - Test::BoolSeq ret = t->opBoolRange(in, out); - test(out == in); - test(ret == in); - } - - { - Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - Test::ByteList out; - Test::ByteList ret = t->opByteRange(in, out); - test(out == in); - test(ret == in); - } - - { - Test::VariableList in; - Test::Variable v; - v.s = "THESE"; - in.push_back(v); - v.s = "ARE"; - in.push_back(v); - v.s = "FIVE"; - in.push_back(v); - v.s = "SHORT"; - in.push_back(v); - v.s = "STRINGS."; - in.push_back(v); - Test::VariableList out; - Test::VariableList ret = t->opVariableRange(in, out); - test(out == in); - test(ret == in); - } - - { - Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - Test::ByteList out; - Test::ByteList ret = t->opByteRangeType(in, out); - test(out == in); - test(ret == in); - } - - { - Test::VariableList in; - deque inSeq; - Test::Variable v; - v.s = "THESE"; - in.push_back(v); - inSeq.push_back(v); - v.s = "ARE"; - in.push_back(v); - inSeq.push_back(v); - v.s = "FIVE"; - in.push_back(v); - inSeq.push_back(v); - v.s = "SHORT"; - in.push_back(v); - inSeq.push_back(v); - v.s = "STRINGS."; - in.push_back(v); - inSeq.push_back(v); - Test::VariableList out; - Test::VariableList ret = t->opVariableRangeType(in, out); - test(out == in); - test(ret == in); - } - { deque in(5); in[0] = false; @@ -700,86 +617,6 @@ allTests(Test::TestHelper* helper) test(std::get<0>(r) == in); } - { - Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - auto r = t->opBoolRangeAsync(in).get(); - test(std::get<1>(r) == in); - test(std::get<0>(r) == in); - } - - { - Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - - auto r = t->opByteRangeAsync(in).get(); - test(std::get<1>(r) == in); - test(std::get<0>(r) == in); - } - - { - Test::VariableList in; - Test::Variable v; - v.s = "THESE"; - in.push_back(v); - v.s = "ARE"; - in.push_back(v); - v.s = "FIVE"; - in.push_back(v); - v.s = "SHORT"; - in.push_back(v); - v.s = "STRINGS."; - in.push_back(v); - auto r = t->opVariableRangeAsync(in).get(); - test(std::get<1>(r) == in); - test(std::get<0>(r) == in); - } - - { - Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - auto r = t->opByteRangeTypeAsync(in).get(); - test(std::get<1>(r) == in); - test(std::get<0>(r) == in); - } - - { - Test::VariableList in; - deque inSeq; - Test::Variable v; - v.s = "THESE"; - in.push_back(v); - inSeq.push_back(v); - v.s = "ARE"; - in.push_back(v); - inSeq.push_back(v); - v.s = "FIVE"; - in.push_back(v); - inSeq.push_back(v); - v.s = "SHORT"; - in.push_back(v); - inSeq.push_back(v); - v.s = "STRINGS."; - in.push_back(v); - inSeq.push_back(v); - - auto r = t->opVariableRangeTypeAsync(in).get(); - test(std::get<1>(r) == in); - test(std::get<0>(r) == in); - } - { deque in(5); in[0] = false; @@ -1078,18 +915,6 @@ allTests(Test::TestHelper* helper) test(r.size() == in.size()); test(r == in); } - - { - Test::ByteSeq in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - - auto r = t->opOutRangeByteSeqAsync(in).get(); - test(r.size() == in.size()); - test(r == in); - } } cout << "ok" << endl; @@ -1219,148 +1044,6 @@ allTests(Test::TestHelper* helper) test(done.get_future().get()); } - { - Test::BoolSeq in(5); - in[0] = false; - in[1] = true; - in[2] = true; - in[3] = false; - in[4] = true; - - promise done; - - t->opBoolRangeAsync(in, - [&](Test::BoolSeq ret, Test::BoolSeq out) - { - test(ret == in); - test(out == in); - done.set_value(true); - }, - [&](std::exception_ptr) - { - done.set_value(false); - }); - - test(done.get_future().get()); - } - - { - Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - - promise done; - - t->opByteRangeAsync(in, - [&](Test::ByteList ret, Test::ByteList out) - { - test(ret == in); - test(out == in); - done.set_value(true); - }, - [&](std::exception_ptr) - { - done.set_value(false); - }); - - test(done.get_future().get()); - } - - { - Test::VariableList in; - Test::Variable v; - v.s = "THESE"; - in.push_back(v); - v.s = "ARE"; - in.push_back(v); - v.s = "FIVE"; - in.push_back(v); - v.s = "SHORT"; - in.push_back(v); - v.s = "STRINGS."; - in.push_back(v); - - promise done; - - t->opVariableRangeAsync(in, - [&](Test::VariableList ret, Test::VariableList out) - { - test(ret == in); - test(out == in); - done.set_value(true); - }, - [&](std::exception_ptr) - { - done.set_value(false); - }); - - test(done.get_future().get()); - } - - { - Test::ByteList in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - in.push_back('5'); - - promise done; - - t->opByteRangeTypeAsync(in, - [&](Test::ByteList ret, Test::ByteList out) - { - test(ret == in); - test(out == in); - done.set_value(true); - }, - [&](std::exception_ptr) - { - done.set_value(false); - }); - - test(done.get_future().get()); - } - - { - Test::VariableList in; - deque inSeq; - Test::Variable v; - v.s = "THESE"; - in.push_back(v); - inSeq.push_back(v); - v.s = "ARE"; - in.push_back(v); - inSeq.push_back(v); - v.s = "FIVE"; - in.push_back(v); - inSeq.push_back(v); - v.s = "SHORT"; - in.push_back(v); - inSeq.push_back(v); - v.s = "STRINGS."; - in.push_back(v); - inSeq.push_back(v); - promise done; - - t->opVariableRangeTypeAsync(in, - [&](Test::VariableList ret, Test::VariableList out) - { - test(ret == in); - test(out == in); - done.set_value(true); - }, - [&](std::exception_ptr) - { - done.set_value(false); - }); - - test(done.get_future().get()); - } - { deque in(5); in[0] = false; @@ -1884,29 +1567,6 @@ allTests(Test::TestHelper* helper) test(done.get_future().get()); } - { - Test::ByteSeq in; - in.push_back('1'); - in.push_back('2'); - in.push_back('3'); - in.push_back('4'); - - promise done; - - t->opOutRangeByteSeqAsync(in, - [&](Test::ByteSeq out) - { - test(out == in); - done.set_value(true); - }, - [&](std::exception_ptr) - { - done.set_value(false); - }); - - test(done.get_future().get()); - } - cout << "ok" << endl; cout << "testing alternate dictionaries with new AMI... " << flush; diff --git a/cpp/test/Ice/custom/Test.ice b/cpp/test/Ice/custom/Test.ice index a31fc862698..72a50747990 100644 --- a/cpp/test/Ice/custom/Test.ice +++ b/cpp/test/Ice/custom/Test.ice @@ -45,7 +45,7 @@ sequence FixedSeq; sequence FixedListSeq; ["cpp:type:std::list< ::Test::FixedSeq>"] sequence FixedSeqList; -["cpp:comparable"] struct Variable +struct Variable { string s; BoolList bl; @@ -77,7 +77,7 @@ sequence EListSeq; class C {} sequence CSeq; -["cpp:type:std::list< ::Test::CPtr>", "cpp11:type:std::list>"] sequence CList; +["cpp:type:std::list>"] sequence CList; ["cpp:type:std::list< ::Test::CList>"] sequence CListList; sequence CListSeq; @@ -85,7 +85,7 @@ sequence CListSeq; interface D {} sequence DPrxSeq; -["cpp:type:std::list< ::Test::DPrx>", "cpp11:type:std::list"] sequence DPrxList; +["cpp:type:std::list"] sequence DPrxList; ["cpp:type:std::list< ::Test::DPrxList>"] sequence DPrxListList; sequence DPrxListSeq; @@ -93,20 +93,6 @@ sequence DPrxListSeq; sequence DoubleSeq; -["cpp:class"] struct ClassOtherStruct -{ - int x; -} -sequence ClassOtherStructSeq; - -["cpp:class", "cpp:comparable"] struct ClassStruct -{ - ClassOtherStructSeq otherSeq; - ClassOtherStruct other; - int y; -} -sequence ClassStructSeq; - ["cpp:type:Test::CustomMap"] dictionary IntStringDict; dictionary LongLongDict; dictionary StringIntDict; @@ -123,7 +109,7 @@ class DictClass ["cpp:type:Test::CustomBuffer"] sequence FloatBuffer; ["cpp:type:Test::CustomBuffer"] sequence DoubleBuffer; ["cpp:type:Test::CustomBuffer"] sequence ByteBuffer; -["cpp:comparable"] struct BufferStruct +struct BufferStruct { ByteBuffer byteBuf; BoolBuffer boolBuf; @@ -144,19 +130,6 @@ interface TestIntf ["cpp:array"] VariableList opVariableArray(["cpp:array"] VariableList inSeq, out ["cpp:array"] VariableList outSeq); - ["cpp:range"] BoolSeq opBoolRange(["cpp:range"] BoolSeq inSeq, out ["cpp:range"] BoolSeq outSeq); - - ["cpp:range"] ByteList opByteRange(["cpp:range"] ByteList inSeq, out ["cpp:range"] ByteList outSeq); - - ["cpp:range"] VariableList opVariableRange(["cpp:range"] VariableList inSeq, out ["cpp:range"] VariableList outSeq); - - ["cpp:range:::Test::ByteList"] ByteList opByteRangeType(["cpp:range:::Test::ByteList"] ByteList inSeq, - out ["cpp:range:::Test::ByteList"] ByteList outSeq); - - ["cpp:range:std::deque< ::Test::Variable>"] VariableList - opVariableRangeType(["cpp:range:std::deque< ::Test::Variable>"] VariableList inSeq, - out ["cpp:range:std::deque< ::Test::Variable>"] VariableList outSeq); - ["cpp:type:std::deque"] BoolSeq opBoolSeq(["cpp:type:std::deque"] BoolSeq inSeq, out ["cpp:type:std::deque"]BoolSeq outSeq); @@ -165,8 +138,6 @@ interface TestIntf BoolDequeList opBoolDequeList(BoolDequeList inSeq, out BoolDequeList outSeq); ["cpp:array"] BoolDequeList opBoolDequeListArray(["cpp:array"] BoolDequeList inSeq, out ["cpp:array"] BoolDequeList outSeq); - ["cpp:range"] BoolDequeList opBoolDequeListRange(["cpp:range"] BoolDequeList inSeq, - out ["cpp:range"] BoolDequeList outSeq); ["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq opByteSeq(["cpp:type:std::deque< ::Ice::Byte>"] ByteSeq inSeq, @@ -206,24 +177,20 @@ interface TestIntf EList opEList(EList inSeq, out EList outSeq); - ["cpp:type:std::deque< ::Test::DPrx>", "cpp11:type:std::deque<::Test::DPrxPtr>"] DPrxSeq - opDPrxSeq(["cpp:type:std::deque< ::Test::DPrx>", "cpp11:type:std::deque<::Test::DPrxPtr>"] DPrxSeq inSeq, - out ["cpp:type:std::deque< ::Test::DPrx>", "cpp11:type:std::deque<::Test::DPrxPtr>"] DPrxSeq outSeq); + ["cpp:type:std::deque<::Test::DPrxPtr>"] DPrxSeq + opDPrxSeq(["cpp:type:std::deque<::Test::DPrxPtr>"] DPrxSeq inSeq, + out ["cpp:type:std::deque<::Test::DPrxPtr>"] DPrxSeq outSeq); DPrxList opDPrxList(DPrxList inSeq, out DPrxList outSeq); - ["cpp:type:std::deque< ::Test::CPtr>", "cpp11:type:std::deque>"] CSeq - opCSeq(["cpp:type:std::deque< ::Test::CPtr>", "cpp11:type:std::deque>"] CSeq inSeq, - out ["cpp:type:std::deque< ::Test::CPtr>", "cpp11:type:std::deque>"] CSeq outSeq); + ["cpp:type:std::deque>"] CSeq + opCSeq(["cpp:type:std::deque>"] CSeq inSeq, + out ["cpp:type:std::deque>"] CSeq outSeq); CList opCList(CList inSeq, out CList outSeq); - ClassStruct opClassStruct(ClassStruct inS, ClassStructSeq inSeq, out ClassStruct outS, out ClassStructSeq outSeq); - void opOutArrayByteSeq(ByteSeq org, out ["cpp:array"] ByteSeq copy); - void opOutRangeByteSeq(ByteSeq org, out ["cpp:range"] ByteSeq copy); - IntStringDict opIntStringDict(IntStringDict idict, out IntStringDict odict); ["cpp:type:::Test::CustomMap< int64_t, int64_t>"] LongLongDict diff --git a/cpp/test/Ice/custom/TestAMD.ice b/cpp/test/Ice/custom/TestAMD.ice index 2b34a74ab21..7643eb14980 100644 --- a/cpp/test/Ice/custom/TestAMD.ice +++ b/cpp/test/Ice/custom/TestAMD.ice @@ -75,7 +75,7 @@ sequence EListSeq; class C {} sequence CSeq; -["cpp:type:std::list< ::Test::CPtr>", "cpp11:type:std::list>"] sequence CList; +["cpp:type:std::list>"] sequence CList; ["cpp:type:std::list< ::Test::CList>"] sequence CListList; sequence CListSeq; @@ -83,7 +83,7 @@ sequence CListSeq; interface D{} sequence DPrxSeq; -["cpp:type:std::list< ::Test::DPrx>", "cpp11:type:std::list<::Test::DPrxPtr>"] sequence DPrxList; +["cpp:type:std::list<::Test::DPrxPtr>"] sequence DPrxList; ["cpp:type:std::list< ::Test::DPrxList>"] sequence DPrxListList; sequence DPrxListSeq; @@ -91,20 +91,6 @@ sequence DPrxListSeq; sequence DoubleSeq; -["cpp:class"] struct ClassOtherStruct -{ - int x; -} -sequence ClassOtherStructSeq; - -["cpp:class"] struct ClassStruct -{ - ClassOtherStructSeq otherSeq; - ClassOtherStruct other; - int y; -} -sequence ClassStructSeq; - ["cpp:type:Test::CustomMap"] dictionary IntStringDict; dictionary LongLongDict; dictionary StringIntDict; @@ -142,17 +128,6 @@ struct BufferStruct VariableList opVariableArray(["cpp:array"] VariableList inSeq, out VariableList outSeq); - BoolSeq opBoolRange(["cpp:range"] BoolSeq inSeq, out BoolSeq outSeq); - - ["cpp:range"] ByteList opByteRange(["cpp:range"] ByteList inSeq, out ["cpp:range"] ByteList outSeq); - - VariableList opVariableRange(["cpp:range"] VariableList inSeq, out VariableList outSeq); - - ByteList opByteRangeType(["cpp:range:::Test::ByteList"] ByteList inSeq, out ByteList outSeq); - - VariableList - opVariableRangeType(["cpp:range:std::deque< ::Test::Variable>"] VariableList inSeq, out VariableList outSeq); - ["cpp:type:std::deque"] BoolSeq opBoolSeq(["cpp:type:std::deque"] BoolSeq inSeq, out ["cpp:type:std::deque"]BoolSeq outSeq); @@ -196,24 +171,20 @@ struct BufferStruct EList opEList(EList inSeq, out EList outSeq); - ["cpp:type:std::deque< ::Test::DPrx>", "cpp11:type:std::deque<::Test::DPrxPtr>"] DPrxSeq - opDPrxSeq(["cpp:type:std::deque< ::Test::DPrx>", "cpp11:type:std::deque<::Test::DPrxPtr>"] DPrxSeq inSeq, - out ["cpp:type:std::deque< ::Test::DPrx>", "cpp11:type:std::deque<::Test::DPrxPtr>"] DPrxSeq outSeq); + ["cpp:type:std::deque<::Test::DPrxPtr>"] DPrxSeq + opDPrxSeq(["cpp:type:std::deque<::Test::DPrxPtr>"] DPrxSeq inSeq, + out ["cpp:type:std::deque<::Test::DPrxPtr>"] DPrxSeq outSeq); DPrxList opDPrxList(DPrxList inSeq, out DPrxList outSeq); - ["cpp:type:std::deque< ::Test::CPtr>", "cpp11:type:std::deque>"] CSeq - opCSeq(["cpp:type:std::deque< ::Test::CPtr>", "cpp11:type:std::deque>"] CSeq inSeq, - out ["cpp:type:std::deque< ::Test::CPtr>", "cpp11:type:std::deque>"] CSeq outSeq); + ["cpp:type:std::deque>"] CSeq + opCSeq(["cpp:type:std::deque>"] CSeq inSeq, + out ["cpp:type:std::deque>"] CSeq outSeq); CList opCList(CList inSeq, out CList outSeq); - ClassStruct opClassStruct(ClassStruct inS, ClassStructSeq inSeq, out ClassStruct outS, out ClassStructSeq outSeq); - void opOutArrayByteSeq(ByteSeq org, out ["cpp:array"] ByteSeq copy); - void opOutRangeByteSeq(ByteSeq org, out ["cpp:range"] ByteSeq copy); - IntStringDict opIntStringDict(IntStringDict idict, out IntStringDict odict); ["cpp:type:::Test::CustomMap< int64_t, int64_t>"] LongLongDict diff --git a/cpp/test/Ice/custom/TestAMDI.cpp b/cpp/test/Ice/custom/TestAMDI.cpp index 5e8f2802533..c2d38d943ee 100644 --- a/cpp/test/Ice/custom/TestAMDI.cpp +++ b/cpp/test/Ice/custom/TestAMDI.cpp @@ -41,47 +41,6 @@ TestIntfI::opVariableArrayAsync(std::pair response, - std::function, const Ice::Current&) -{ - response(in, in); -} - -void -TestIntfI::opByteRangeAsync(Test::ByteList in, - std::function response, - std::function, const Ice::Current&) -{ - response(in, in); -} - -void -TestIntfI::opVariableRangeAsync(Test::VariableList in, - std::function response, - std::function, const Ice::Current&) -{ - response(in, in); -} - -void -TestIntfI::opByteRangeTypeAsync(Test::ByteList in, - std::function response, - std::function, const Ice::Current&) -{ - response(in, in); -} - -void -TestIntfI::opVariableRangeTypeAsync(Test::VariableList in, - std::function response, - std::function, const Ice::Current&) -{ - response(in, in); -} - void TestIntfI::opBoolSeqAsync(std::deque in, std::function&, const std::deque&)> response, @@ -240,15 +199,6 @@ TestIntfI::opCListAsync(Test::CList in, response(in, in); } -void -TestIntfI::opClassStructAsync(Test::ClassStruct in1, Test::ClassStructSeq in2, - std::function response, - std::function, const Ice::Current&) -{ - response(in1, in1, in2); -} - void TestIntfI::opOutArrayByteSeqAsync(Test::ByteSeq in, std::function&)> response, @@ -257,14 +207,6 @@ TestIntfI::opOutArrayByteSeqAsync(Test::ByteSeq in, response(std::make_pair(in.data(), in.data() + in.size())); } -void -TestIntfI::opOutRangeByteSeqAsync(Test::ByteSeq in, - std::function response, - std::function, const Ice::Current&) -{ - response(in); -} - void TestIntfI::opIntStringDictAsync(Test::IntStringDict in, std::function response, diff --git a/cpp/test/Ice/custom/TestAMDI.h b/cpp/test/Ice/custom/TestAMDI.h index b71ff17ed5d..4705011d4b5 100644 --- a/cpp/test/Ice/custom/TestAMDI.h +++ b/cpp/test/Ice/custom/TestAMDI.h @@ -27,27 +27,6 @@ class TestIntfI : public virtual Test::TestIntf std::function, std::function, const Ice::Current&) override; - void opBoolRangeAsync(Test::BoolSeq, - std::function, - std::function, const Ice::Current&) override; - - void opByteRangeAsync(Test::ByteList, - std::function, - std::function, const Ice::Current&) override; - - void opVariableRangeAsync(Test::VariableList, - std::function, - std::function, const Ice::Current&) override; - - void opByteRangeTypeAsync(Test::ByteList, - std::function, - std::function, const Ice::Current&) override; - - void opVariableRangeTypeAsync(Test::VariableList, - std::function, - std::function, const Ice::Current&) override; - void opBoolSeqAsync(std::deque, std::function&, const std::deque&)>, std::function, const Ice::Current&) override; @@ -130,19 +109,10 @@ class TestIntfI : public virtual Test::TestIntf std::function, std::function, const Ice::Current&) override; - void opClassStructAsync(::Test::ClassStruct, ::Test::ClassStructSeq, - std::function, - std::function, const Ice::Current&) override; - void opOutArrayByteSeqAsync(::Test::ByteSeq, std::function&)>, std::function, const Ice::Current&) override; - void opOutRangeByteSeqAsync(::Test::ByteSeq, - std::function, - std::function, const Ice::Current&) override; - void opIntStringDictAsync(::Test::IntStringDict, std::function, std::function, const Ice::Current&) override; diff --git a/cpp/test/Ice/custom/TestI.cpp b/cpp/test/Ice/custom/TestI.cpp index 94beda2cba7..5844a01d03d 100644 --- a/cpp/test/Ice/custom/TestI.cpp +++ b/cpp/test/Ice/custom/TestI.cpp @@ -41,13 +41,6 @@ TestIntfI::opVariableArray(std::pair inSeq, return inSeq; } -Test::ClassStruct -TestIntfI::opClassStruct(Test::ClassStruct inS, - Test::ClassStructSeq inSeq, - Test::ClassStruct& out, - Test::ClassStructSeq& outSeq, - const Ice::Current&) -{ - outSeq = std::move(inSeq); - out = inS; - return inS; -} - void TestIntfI::opOutArrayByteSeq(Test::ByteSeq data, Test::ByteSeq& copy, const Ice::Current&) { diff --git a/cpp/test/Ice/custom/TestI.h b/cpp/test/Ice/custom/TestI.h index ae367e5d3ce..edd163d4a7e 100644 --- a/cpp/test/Ice/custom/TestI.h +++ b/cpp/test/Ice/custom/TestI.h @@ -27,8 +27,6 @@ class TestIntfI : public virtual Test::TestIntf Test::VariableList&, const Ice::Current&); - virtual Test::BoolSeq opBoolRange(Test::BoolSeq, Test::BoolSeq&, const Ice::Current&); - virtual Test::ByteList opByteRange(Test::ByteList, Test::ByteList&, const Ice::Current&); virtual Test::VariableList @@ -126,12 +124,6 @@ class TestIntfI : public virtual Test::TestIntf std::list< ::Test::CPtr>&, const Ice::Current&); - virtual Test::ClassStruct opClassStruct(Test::ClassStruct, - Test::ClassStructSeq, - Test::ClassStruct& out, - Test::ClassStructSeq& outSeq, - const Ice::Current&); - virtual void opOutArrayByteSeq(Test::ByteSeq, Test::ByteSeq&, const Ice::Current&); virtual void opOutRangeByteSeq(Test::ByteSeq, Test::ByteSeq&, const Ice::Current&); diff --git a/cpp/test/Ice/defaultValue/Test.ice b/cpp/test/Ice/defaultValue/Test.ice index 9e591c2b442..c8cefe0282c 100644 --- a/cpp/test/Ice/defaultValue/Test.ice +++ b/cpp/test/Ice/defaultValue/Test.ice @@ -89,7 +89,6 @@ struct Struct2 double zeroDotD = ConstZeroDotD; } -["cpp:class"] struct Struct3 { bool boolFalse = false; diff --git a/cpp/test/Ice/optional/Test.ice b/cpp/test/Ice/optional/Test.ice index 8cf9a131399..6c00298279a 100644 --- a/cpp/test/Ice/optional/Test.ice +++ b/cpp/test/Ice/optional/Test.ice @@ -39,11 +39,6 @@ struct VarStruct string m; } -["cpp:class"] struct ClassVarStruct -{ - int a; -} - sequence ByteSeq; sequence BoolSeq; sequence ShortSeq; @@ -164,7 +159,6 @@ class OptionalWithCustom { optional(1) SmallStructList l; ["protected"] optional(2) SmallStructList lp; - optional(3) ClassVarStruct s; } class E @@ -268,8 +262,7 @@ interface Initial ["cpp:array"] optional(1) DoubleSeq opDoubleSeq(["cpp:array"] optional(2) DoubleSeq p1, out ["cpp:array"] optional(3) DoubleSeq p3); - ["cpp:range"] optional(1) StringSeq opStringSeq(["cpp:range"] optional(2) StringSeq p1, - out ["cpp:range"] optional(3) StringSeq p3); + optional(1) StringSeq opStringSeq(optional(2) StringSeq p1, out optional(3) StringSeq p3); ["cpp:array"] optional(1) SmallStructSeq opSmallStructSeq(["cpp:array"] optional(2) SmallStructSeq p1, out ["cpp:array"] optional(3) SmallStructSeq p3); @@ -283,8 +276,7 @@ interface Initial ["cpp:array"] optional(1) FixedStructList opFixedStructList(["cpp:array"] optional(2) FixedStructList p1, out ["cpp:array"] optional(3) FixedStructList p3); - ["cpp:range"] optional(1) VarStructSeq opVarStructSeq(["cpp:range"] optional(2) VarStructSeq p1, - out ["cpp:range"] optional(3) VarStructSeq p3); + optional(1) VarStructSeq opVarStructSeq(optional(2) VarStructSeq p1, out optional(3) VarStructSeq p3); optional(1) Serializable opSerializable(optional(2) Serializable p1, out optional(3) Serializable p3); diff --git a/cpp/test/Ice/optional/TestAMD.ice b/cpp/test/Ice/optional/TestAMD.ice index 25d4f620356..1d29a405869 100644 --- a/cpp/test/Ice/optional/TestAMD.ice +++ b/cpp/test/Ice/optional/TestAMD.ice @@ -39,11 +39,6 @@ struct VarStruct string m; } -["cpp:class"] struct ClassVarStruct -{ - int a; -} - sequence ByteSeq; sequence BoolSeq; sequence ShortSeq; @@ -164,7 +159,6 @@ class OptionalWithCustom { optional(1) SmallStructList l; ["protected"] optional(2) SmallStructList lp; - optional(3) ClassVarStruct s; } class E @@ -269,9 +263,7 @@ interface Initial ["cpp:array"] optional(1) DoubleSeq opDoubleSeq(["cpp:array"] optional(2) DoubleSeq p1, out ["cpp:array"] optional(3) DoubleSeq p3); - ["cpp:range"] optional(1) StringSeq opStringSeq(["cpp:range"] optional(2) StringSeq p1, - out ["cpp:range"] optional(3) StringSeq p3); - + optional(1) StringSeq opStringSeq(optional(2) StringSeq p1, out optional(3) StringSeq p3); ["cpp:array"] optional(1) SmallStructSeq opSmallStructSeq(["cpp:array"] optional(2) SmallStructSeq p1, out ["cpp:array"] optional(3) SmallStructSeq p3); @@ -284,8 +276,7 @@ interface Initial ["cpp:array"] optional(1) FixedStructList opFixedStructList(["cpp:array"] optional(2) FixedStructList p1, out ["cpp:array"] optional(3) FixedStructList p3); - ["cpp:range"] optional(1) VarStructSeq opVarStructSeq(["cpp:range"] optional(2) VarStructSeq p1, - out ["cpp:range"] optional(3) VarStructSeq p3); + optional(1) VarStructSeq opVarStructSeq(optional(2) VarStructSeq p1, out optional(3) VarStructSeq p3); optional(1) Serializable opSerializable(optional(2) Serializable p1, out optional(3) Serializable p3); diff --git a/cpp/test/Ice/stream/Test.ice b/cpp/test/Ice/stream/Test.ice index e682c0abb32..f9f9f8e6a54 100644 --- a/cpp/test/Ice/stream/Test.ice +++ b/cpp/test/Ice/stream/Test.ice @@ -19,7 +19,7 @@ enum MyEnum interface MyInterface; class MyClass; -["cpp:comparable"] struct SmallStruct +struct SmallStruct { bool bo; byte by; @@ -33,7 +33,7 @@ class MyClass; MyInterface* p; } -["cpp:class"] struct ClassStruct +struct ClassStruct { int i; } @@ -104,7 +104,7 @@ module Sub nestedEnum3 } - ["cpp:comparable"] struct NestedStruct + struct NestedStruct { bool bo; byte by; @@ -117,11 +117,6 @@ module Sub NestedEnum e; } - ["cpp:class"] struct NestedClassStruct - { - int i; - } - exception NestedException { string str; @@ -140,7 +135,7 @@ module Sub2 nestedEnum6 } - ["cpp:comparable"] struct NestedStruct2 + struct NestedStruct2 { bool bo; byte by; @@ -153,11 +148,6 @@ module Sub2 NestedEnum2 e; } - ["cpp:class"] struct NestedClassStruct2 - { - int i; - } - exception NestedException2 { string str; diff --git a/cpp/test/Slice/errorDetection/WarningInvalidMetaData.err b/cpp/test/Slice/errorDetection/WarningInvalidMetaData.err index eb57940e553..fd56367b9a0 100644 --- a/cpp/test/Slice/errorDetection/WarningInvalidMetaData.err +++ b/cpp/test/Slice/errorDetection/WarningInvalidMetaData.err @@ -12,9 +12,8 @@ WarningInvalidMetaData.ice: warning: ignoring invalid file metadata `cpp:include WarningInvalidMetaData.ice:35: warning: ignoring invalid metadata `cpp:type:std::list< ::std::string>' for operation with void return type WarningInvalidMetaData.ice:38: warning: ignoring invalid metadata `cpp:view-type:std::string_view' for operation with void return type WarningInvalidMetaData.ice:41: warning: ignoring invalid metadata `cpp:array' for operation with void return type -WarningInvalidMetaData.ice:44: warning: ignoring invalid metadata `cpp:range' for operation with void return type -WarningInvalidMetaData.ice:49: warning: ignoring invalid metadata `cpp:class' -WarningInvalidMetaData.ice:49: warning: ignoring invalid metadata `cpp:comparable' -WarningInvalidMetaData.ice:54: warning: ignoring invalid metadata `cpp:const' -WarningInvalidMetaData.ice:54: warning: ignoring invalid metadata `cpp:ice_print' -WarningInvalidMetaData.ice:60: warning: ignoring invalid metadata `cpp:virtual' +WarningInvalidMetaData.ice:46: warning: ignoring invalid metadata `cpp:const' +WarningInvalidMetaData.ice:46: warning: ignoring invalid metadata `cpp:ice_print' +WarningInvalidMetaData.ice:52: warning: ignoring invalid metadata `cpp:virtual' +WarningInvalidMetaData.ice:57: warning: ignoring invalid metadata `cpp98:foo' +WarningInvalidMetaData.ice:57: warning: ignoring invalid metadata `cpp11:bar' diff --git a/cpp/test/Slice/errorDetection/WarningInvalidMetaData.ice b/cpp/test/Slice/errorDetection/WarningInvalidMetaData.ice index 1bad5711784..0c32889f9e0 100644 --- a/cpp/test/Slice/errorDetection/WarningInvalidMetaData.ice +++ b/cpp/test/Slice/errorDetection/WarningInvalidMetaData.ice @@ -39,14 +39,6 @@ interface I ["cpp:array"] void op3(); - - ["cpp:range"] - void op4(); -} - -["cpp:class", "cpp:comparable"] -class C -{ } ["cpp:const", "cpp:ice_print"] @@ -60,4 +52,9 @@ exception E { } +["cpp98:foo", "cpp11:bar"] // The cpp98 and cpp11 attributes were removed in 3.8. We issue a friendly warning. +class P +{ +} + } diff --git a/cpp/test/Slice/errorDetection/WarningSuppressInvalidMetaData.ice b/cpp/test/Slice/errorDetection/WarningSuppressInvalidMetaData.ice index 03bfa0b0823..b768f376f80 100644 --- a/cpp/test/Slice/errorDetection/WarningSuppressInvalidMetaData.ice +++ b/cpp/test/Slice/errorDetection/WarningSuppressInvalidMetaData.ice @@ -42,15 +42,9 @@ interface I ["cpp:array"] void op3(); - ["cpp:range"] void op4(); } -["cpp:class", "cpp:comparable"] -class C -{ -} - ["cpp:const", "cpp:ice_print"] struct S { diff --git a/cpp/test/Slice/escape/Key.ice b/cpp/test/Slice/escape/Key.ice index 6d5b3197eee..e34a7bd3464 100644 --- a/cpp/test/Slice/escape/Key.ice +++ b/cpp/test/Slice/escape/Key.ice @@ -17,7 +17,7 @@ struct auto int default; } -["cpp:class"] struct delete +struct delete { string else; } diff --git a/cpp/test/Slice/structure/Test.ice b/cpp/test/Slice/structure/Test.ice index 2d7144fdf24..8b4692703e8 100644 --- a/cpp/test/Slice/structure/Test.ice +++ b/cpp/test/Slice/structure/Test.ice @@ -16,13 +16,11 @@ class C int i; } -["cpp:class"] struct S1 { string name; } -["cpp:comparable"] struct S2 { bool bo; diff --git a/js/test/Ice/defaultValue/Test.ice b/js/test/Ice/defaultValue/Test.ice index 89949548c89..96552f7ed7a 100644 --- a/js/test/Ice/defaultValue/Test.ice +++ b/js/test/Ice/defaultValue/Test.ice @@ -89,7 +89,6 @@ struct Struct2 double zeroDotD = ConstZeroDotD; } -["cpp:class"] struct Struct3 { bool boolFalse = false; diff --git a/js/test/typescript/Ice/defaultValue/Test.ice b/js/test/typescript/Ice/defaultValue/Test.ice index 300a9b45bef..f5fd8392b32 100644 --- a/js/test/typescript/Ice/defaultValue/Test.ice +++ b/js/test/typescript/Ice/defaultValue/Test.ice @@ -89,7 +89,6 @@ struct Struct2 double zeroDotD = ConstZeroDotD; } -["cpp:class"] struct Struct3 { bool boolFalse = false; diff --git a/slice/IceGrid/Admin.ice b/slice/IceGrid/Admin.ice index b8d76d47d31..8a3b0d4ad0c 100644 --- a/slice/IceGrid/Admin.ice +++ b/slice/IceGrid/Admin.ice @@ -57,7 +57,6 @@ enum ServerState dictionary StringObjectProxyDict; /// Information about an Ice object. -["cpp:comparable"] struct ObjectInfo { /// The proxy of the object. @@ -71,7 +70,6 @@ struct ObjectInfo sequence ObjectInfoSeq; /// Information about an adapter registered with the IceGrid registry. -["cpp:comparable"] struct AdapterInfo { /// The id of the adapter. diff --git a/slice/IceGrid/Descriptor.ice b/slice/IceGrid/Descriptor.ice index 54d8b1301db..5232cf27dd8 100644 --- a/slice/IceGrid/Descriptor.ice +++ b/slice/IceGrid/Descriptor.ice @@ -45,7 +45,6 @@ struct PropertyDescriptor ["java:type:java.util.LinkedList"] sequence PropertyDescriptorSeq; /// A property set descriptor. -["cpp:comparable"] struct PropertySetDescriptor { /// References to named property sets. @@ -76,7 +75,6 @@ struct ObjectDescriptor ["java:type:java.util.LinkedList"] sequence ObjectDescriptorSeq; /// An Ice object adapter descriptor. -["cpp:comparable"] struct AdapterDescriptor { /// The object adapter name. @@ -130,7 +128,6 @@ class CommunicatorDescriptor } /// A distribution descriptor defines an IcePatch2 server and the directories to retrieve from the patch server. -["cpp:comparable"] struct DistributionDescriptor { /// The proxy of the IcePatch2 server. @@ -202,7 +199,6 @@ class ServiceDescriptor extends CommunicatorDescriptor ["java:type:java.util.LinkedList"] sequence ServiceDescriptorSeq; /// A server template instance descriptor. -["cpp:comparable"] struct ServerInstanceDescriptor { /// The template used by this instance. diff --git a/swift/test/Ice/defaultValue/Test.ice b/swift/test/Ice/defaultValue/Test.ice index 5b416705d60..ace3cffc171 100644 --- a/swift/test/Ice/defaultValue/Test.ice +++ b/swift/test/Ice/defaultValue/Test.ice @@ -90,7 +90,6 @@ struct Struct2 double zeroDotD = ConstZeroDotD; } -["cpp:class"] struct Struct3 { bool boolFalse = false; diff --git a/swift/test/Ice/optional/Test.ice b/swift/test/Ice/optional/Test.ice index 001442a5fac..ca580eb6e23 100644 --- a/swift/test/Ice/optional/Test.ice +++ b/swift/test/Ice/optional/Test.ice @@ -272,8 +272,7 @@ interface Initial ["cpp:array"] optional(1) DoubleSeq opDoubleSeq(["cpp:array"] optional(2) DoubleSeq p1, out ["cpp:array"] optional(3) DoubleSeq p3); - ["cpp:range"] optional(1) StringSeq opStringSeq(["cpp:range"] optional(2) StringSeq p1, - out ["cpp:range"] optional(3) StringSeq p3); + optional(1) StringSeq opStringSeq(optional(2) StringSeq p1, out optional(3) StringSeq p3); ["cpp:array"] optional(1) SmallStructSeq opSmallStructSeq(["cpp:array"] optional(2) SmallStructSeq p1, out ["cpp:array"] optional(3) SmallStructSeq p3); @@ -287,8 +286,7 @@ interface Initial ["cpp:array"] optional(1) FixedStructList opFixedStructList(["cpp:array"] optional(2) FixedStructList p1, out ["cpp:array"] optional(3) FixedStructList p3); - ["cpp:range"] optional(1) VarStructSeq opVarStructSeq(["cpp:range"] optional(2) VarStructSeq p1, - out ["cpp:range"] optional(3) VarStructSeq p3); + optional(1) VarStructSeq opVarStructSeq(optional(2) VarStructSeq p1, out optional(3) VarStructSeq p3); optional(1) Serializable opSerializable(optional(2) Serializable p1, out optional(3) Serializable p3); diff --git a/swift/test/Ice/stream/Test.ice b/swift/test/Ice/stream/Test.ice index 59487d36554..0bf490b784f 100644 --- a/swift/test/Ice/stream/Test.ice +++ b/swift/test/Ice/stream/Test.ice @@ -25,7 +25,7 @@ enum MyEnum interface MyInterface; class MyClass; -["cpp:comparable"] struct SmallStruct +struct SmallStruct { bool bo; byte by; @@ -39,11 +39,6 @@ class MyClass; MyInterface* p; } -["cpp:class"] struct ClassStruct -{ - int i; -} - class OptionalClass { bool bo; @@ -110,7 +105,7 @@ module Sub nestedEnum3 } - ["cpp:comparable"] struct NestedStruct + struct NestedStruct { bool bo; byte by; @@ -123,11 +118,6 @@ module Sub NestedEnum e; } - ["cpp:class"] struct NestedClassStruct - { - int i; - } - exception NestedException { string str; @@ -147,7 +137,7 @@ module Sub2 nestedEnum6 } - ["cpp:comparable"] struct NestedStruct2 + struct NestedStruct2 { bool bo; byte by; @@ -160,11 +150,6 @@ module Sub2 NestedEnum2 e; } - ["cpp:class"] struct NestedClassStruct2 - { - int i; - } - exception NestedException2 { string str; diff --git a/swift/test/Slice/escape/Key.ice b/swift/test/Slice/escape/Key.ice index 5a35e0fb801..b74babcffb8 100644 --- a/swift/test/Slice/escape/Key.ice +++ b/swift/test/Slice/escape/Key.ice @@ -19,7 +19,7 @@ struct guard int default; } -["cpp:class"] struct defer +struct defer { string else; }