diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 45 | ||||
-rw-r--r-- | cpp/test/Slice/errorDetection/CaseInsensitive.err | 23 | ||||
-rw-r--r-- | cpp/test/Slice/errorDetection/CaseInsensitive.ice | 13 | ||||
-rw-r--r-- | cpp/test/Slice/errorDetection/IdentAsKeyword.err | 4 |
4 files changed, 43 insertions, 42 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index a4741fd589b..e701b3dbdbf 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -714,10 +714,9 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) continue; // Ignore class definitions } - if(printError && matches.front()->name() != sc) + if(printError && matches.front()->scoped() != (thisScope() + sc)) { - string msg; - msg = "type name `" + sc; + string msg = (*p)->kindOf() + " name `" + scoped; msg += "' is capitalized inconsistently with its previous name: `"; msg += matches.front()->scoped() + "'"; _unit->warning(msg); // TODO: change to error in stable_39 @@ -752,10 +751,10 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) continue; // Ignore class definitions } - if(printError && matches.front()->name() != sc) + if(printError && matches.front()->scoped() != (thisScope() + sc)) { - string msg; - msg = "type name `" + sc + "' is capitalized inconsistently with its previous name: `"; + string msg = (*p)->kindOf() + " name `" + scoped; + msg += "' is capitalized inconsistently with its previous name: `"; msg += matches.front()->scoped() + "'"; _unit->warning(msg); // TODO: change to error in stable_39 } @@ -841,15 +840,13 @@ Slice::Container::lookupContained(const string& scoped, bool printError) { results.push_back(*p); - if(printError && (*p)->name() != sc) + if(printError && (*p)->scoped() != (thisScope() + sc)) { - string msg; - msg = "`" + sc + "' is capitalized inconsistently with its previous name: `"; - msg += (*p)->scoped() + "'"; + string msg = (*p)->kindOf() + " name `" + scoped; + msg += "' is capitalized inconsistently with its previous name: `" + (*p)->scoped() + "'"; _unit->warning(msg); // TODO: change to error in stable_39 } } - } if(results.empty()) @@ -877,7 +874,7 @@ Slice::Container::lookupContained(const string& scoped, bool printError) ExceptionPtr Slice::Container::lookupException(const string& scoped, bool printError) { - ContainedList contained = lookupContained(scoped, false); + ContainedList contained = lookupContained(scoped, printError); if(contained.empty()) { return 0; @@ -898,22 +895,6 @@ Slice::Container::lookupException(const string& scoped, bool printError) } return 0; } - string sc; - if(scoped.size() >= 2 && scoped[0] == ':') - { - sc = scoped.substr(2); - } - else - { - sc = scoped; - } - if(printError && (*p)->name() != sc) - { - string msg; - msg = "exception name `" + scoped + "' is capitalized inconsistently with its previous name: `"; - msg += (*p)->scoped() + "'"; - _unit->warning(msg); // TODO: change to error in stable_39 - } exceptions.push_back(ex); } assert(exceptions.size() == 1); @@ -1511,8 +1492,12 @@ Slice::ClassDecl::uses(const ContainedPtr&) const string Slice::ClassDecl::kindOf() const { - string s = _interface ? "interface" : "class"; - s += " declaration"; + string s; + if(isLocal()) + { + s += "local "; + } + s += _interface ? "interface" : "class"; return s; } diff --git a/cpp/test/Slice/errorDetection/CaseInsensitive.err b/cpp/test/Slice/errorDetection/CaseInsensitive.err index 79b565554f1..3f328d29d98 100644 --- a/cpp/test/Slice/errorDetection/CaseInsensitive.err +++ b/cpp/test/Slice/errorDetection/CaseInsensitive.err @@ -44,13 +44,20 @@ CaseInsensitive.ice:157: redefinition of enumeration `en1' as enumerator CaseInsensitive.ice:158: warning: enumerator `EN1' differs only in capitalization from enumeration `en1' CaseInsensitive.ice:159: redefinition of module `m1' as enumerator CaseInsensitive.ice:160: warning: enumerator `M1' differs only in capitalization from module `m1' -CaseInsensitive.ice:172: warning: type name `base' is capitalized inconsistently with its previous name: `::xxx::xx::Base' +CaseInsensitive.ice:172: warning: interface name `base' is capitalized inconsistently with its previous name: `::xxx::xx::Base' CaseInsensitive.ice:172: redefinition of interface `Derived' CaseInsensitive.ice:176: warning: exception name `E1' is capitalized inconsistently with its previous name: `::xxx::xx::e1' -CaseInsensitive.ice:180: warning: type name `S1' is capitalized inconsistently with its previous name: `::xxx::xx::s1' -CaseInsensitive.ice:181: `xx::S1' is not defined -CaseInsensitive.ice:182: warning: type name `XX::s1' is capitalized inconsistently with its previous name: `::xxx::xx::s1' -CaseInsensitive.ice:187: warning: type name `derived' is capitalized inconsistently with its previous name: `::xxx::xx::Derived' -CaseInsensitive.ice:195: warning: parameter `param' differs only in capitalization from parameter `Param' -CaseInsensitive.ice:197: warning: exception name `E1' is capitalized inconsistently with its previous name: `::e1' -CaseInsensitive.ice:210: ambiguous multiple inheritance: `derived' inherits operations `op' and `OP', which differ only in capitalization, from unrelated base interfaces +CaseInsensitive.ice:180: warning: sequence name `S1' is capitalized inconsistently with its previous name: `::xxx::xx::s1' +CaseInsensitive.ice:181: warning: sequence name `xxx::xx::S1' is capitalized inconsistently with its previous name: `::xxx::xx::s1' +CaseInsensitive.ice:182: warning: sequence name `xxx::XX::s1' is capitalized inconsistently with its previous name: `::xxx::xx::s1' +CaseInsensitive.ice:183: warning: sequence name `xxx::XX::s1' is capitalized inconsistently with its previous name: `::xxx::xx::s1' +CaseInsensitive.ice:188: warning: interface name `derived' is capitalized inconsistently with its previous name: `::xxx::xx::Derived' +CaseInsensitive.ice:196: warning: parameter `param' differs only in capitalization from parameter `Param' +CaseInsensitive.ice:198: warning: exception name `E1' is capitalized inconsistently with its previous name: `::e1' +CaseInsensitive.ice:200: warning: exception name `xxx::xx::E1' is capitalized inconsistently with its previous name: `::xxx::xx::e1' +CaseInsensitive.ice:201: warning: exception name `xxx::XX::e1' is capitalized inconsistently with its previous name: `::xxx::xx::e1' +CaseInsensitive.ice:202: warning: exception name `XXX::xx::e1' is capitalized inconsistently with its previous name: `::xxx::xx::e1' +CaseInsensitive.ice:204: warning: exception name `xxx::xx::E1' is capitalized inconsistently with its previous name: `::xxx::xx::e1' +CaseInsensitive.ice:205: warning: exception name `xxx::XX::e1' is capitalized inconsistently with its previous name: `::xxx::xx::e1' +CaseInsensitive.ice:206: warning: exception name `XXX::xx::e1' is capitalized inconsistently with its previous name: `::xxx::xx::e1' +CaseInsensitive.ice:219: ambiguous multiple inheritance: `derived' inherits operations `op' and `OP', which differ only in capitalization, from unrelated base interfaces diff --git a/cpp/test/Slice/errorDetection/CaseInsensitive.ice b/cpp/test/Slice/errorDetection/CaseInsensitive.ice index 8647c3a6125..aee39f70cab 100644 --- a/cpp/test/Slice/errorDetection/CaseInsensitive.ice +++ b/cpp/test/Slice/errorDetection/CaseInsensitive.ice @@ -178,8 +178,9 @@ exception e2 extends E1 {}; sequence<long> s1; struct s { S1 x; - ::xx::S1 y; - XX::s1 z; + ::xxx::xx::S1 y; + ::xxx::XX::s1 z; + xxx::XX::s1 w; }; struct s2 { @@ -195,6 +196,14 @@ interface Foo { void op(long param, string Param); void op2() throws e1; void op3() throws E1; + void op4() throws xxx::xx::e1; + void op5() throws xxx::xx::E1; + void op6() throws xxx::XX::e1; + void op7() throws XXX::xx::e1; + void op8() throws ::xxx::xx::e1; + void op9() throws ::xxx::xx::E1; + void op10() throws ::xxx::XX::e1; + void op11() throws ::XXX::xx::e1; }; module CI diff --git a/cpp/test/Slice/errorDetection/IdentAsKeyword.err b/cpp/test/Slice/errorDetection/IdentAsKeyword.err index 2444ea57075..058922b7cab 100644 --- a/cpp/test/Slice/errorDetection/IdentAsKeyword.err +++ b/cpp/test/Slice/errorDetection/IdentAsKeyword.err @@ -58,10 +58,10 @@ IdentAsKeyword.ice:59: illegal identifier: `VOID' differs from keyword `void' on IdentAsKeyword.ice:59: parse error IdentAsKeyword.ice:59: illegal identifier: `VOID' differs from keyword `void' only in capitalization IdentAsKeyword.ice:61: keyword `local' cannot be used as enumeration name -IdentAsKeyword.ice:61: redefinition of interface declaration `local' as enumeration +IdentAsKeyword.ice:61: redefinition of interface `local' as enumeration IdentAsKeyword.ice:62: illegal identifier: `LOCAL' differs from keyword `local' only in capitalization IdentAsKeyword.ice:62: keyword `local' cannot be used as enumeration name -IdentAsKeyword.ice:62: redefinition of interface declaration `local' as enumeration +IdentAsKeyword.ice:62: redefinition of interface `local' as enumeration IdentAsKeyword.ice:62: warning: enumerator `c' differs only in capitalization from class `C' IdentAsKeyword.ice:64: keyword `long' cannot be used as enumerator IdentAsKeyword.ice:64: keyword `byte' cannot be used as enumerator |