This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: messaging


Arthur Schwarz <aschwarz1309@verizon.net> writes:

> In the following code fragment:
>
> # include <ios>
> # include <fstream>
> # include <istream>
>
> using namespace std;
> void CommandLine(int argc, char** argv);
> int main(int argc, char** argv) {
>    CommandLine(argc, argv[]);
>    ifstream x.open(argv[1], ios:in);
>    ofstream y.open(argv[1], ios::in);
>    
>    return 0;
> };
>
> g++-4 messaging is:
>>> g++-4 x.cpp
> x.cpp: In function 'int main(int, char**)':
> x.cpp:8: error: expected primary-expression before ']' token
> x.cpp:10: error: expected primary-expression before ':' token
>
> A recommendation and reason for change is:
> 1: x.cpp:8 error: illegal to pass an array without subscript value as an 
>    argument
>    The given message is accurate but non-expressive of the reason
>    for failure.
> 3: cpp:10 error: illegal scope resolution operator ':'
>    From memory, there are three uses of ':' in C++
>    ':'   label terminator, <label>:
>    ':'   case in a switch statement, case <value>:
>    ':'   scope resolution operator, "::"
>    The given diagnostic message is deceptive. 


I filed http://gcc.gnu.org/PR39858 and http://gcc.gnu.org/PR39859 to
track these two issues and to make suggestions for how we can improve
them.  Thanks.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]