diff --git a/cpp/src/Slice/Grammar.cpp b/cpp/src/Slice/Grammar.cpp index c9a3c6844b4..befc734acdd 100644 --- a/cpp/src/Slice/Grammar.cpp +++ b/cpp/src/Slice/Grammar.cpp @@ -1884,7 +1884,7 @@ yyparse(void) size_t startPos = 0; if (ident->v.find("::") == 0) { - currentUnit->error("module identifiers cannot start with '::' prefix"); + currentUnit->error("illegal identifier: module identifiers cannot start with '::' prefix"); startPos += 2; // Skip the leading "::". } diff --git a/cpp/src/Slice/Grammar.y b/cpp/src/Slice/Grammar.y index e9975d847ca..0cd83144d59 100644 --- a/cpp/src/Slice/Grammar.y +++ b/cpp/src/Slice/Grammar.y @@ -393,7 +393,7 @@ module_def size_t startPos = 0; if (ident->v.find("::") == 0) { - currentUnit->error("module identifiers cannot start with '::' prefix"); + currentUnit->error("illegal identifier: module identifiers cannot start with '::' prefix"); startPos += 2; // Skip the leading "::". } diff --git a/cpp/test/Slice/errorDetection/NestedModule.err b/cpp/test/Slice/errorDetection/NestedModule.err index d7f94cf5e7d..c512ae124a0 100644 --- a/cpp/test/Slice/errorDetection/NestedModule.err +++ b/cpp/test/Slice/errorDetection/NestedModule.err @@ -6,5 +6,5 @@ NestedModule.ice:20: illegal identifier `Holder': `Holder' suffix is reserved NestedModule.ice:24: illegal identifier `APtr': `Ptr' suffix is reserved NestedModule.ice:24: illegal identifier `BPrx': `Prx' suffix is reserved NestedModule.ice:24: illegal identifier `CHelper': `Helper' suffix is reserved -NestedModule.ice:27: missing identifier: illegal empty identifier +NestedModule.ice:27: illegal identifier: module identifiers cannot start with '::' prefix NestedModule.ice:27: illegal identifier `Helper': `Helper' suffix is reserved