[aspectc-user] a minor bug with reporting syntax errors
Panu Bloigu
panu.bloigu at mbnet.fi
Thu May 17 12:59:54 CEST 2007
Hello.
Just a small addition. The non-explanatory error message occurs also
with switch, so
=============================================================================
aspect Error
{
advice execution("void f()") : around()
{
int i = 0;
switch(i
{
//
}
}
};
void f(){}
int main()
{
f();
return 0;
}
=============================================================================
also gives:
=============================================================================
<anonymous unit>:4: error: invalid member declaration near token `private'
error: Execution failed: "ac++" --config "puma.config" -k -p. -c
"anonerr.cpp" -o "anonerr.acc"
=============================================================================
Panu.
Panu Bloigu wrote:
> Hello.
>
> I think I have found a bug in ac++ 1.0pre3. It concerns reporting
> errors in the syntax of the advice code. The case is, that ac++
> doesn't output a proper error message when a particular type of syntax
> error is seen in the the advice code. Please consider the following code:
>
> =============================================================================
>
> aspect Error
> {
> advice execution("void f()") : around()
> {
> for(;;
> {
> //
> }
> }
> };
>
> void f(){}
>
> int main()
> {
> f();
> return 0;
> }
> =============================================================================
>
>
> As you can see, the tailing parenthesis is missing from the for
> clause. This will cause the compiler simply say:
>
> =============================================================================
>
> <anonymous unit>:4: error: invalid member declaration near token
> `private'
> error: Execution failed: "ac++" --config "puma.config" -k -p. -c
> "anonerr.cpp" -o "anonerr.acc"
> =============================================================================
>
>
> Also note that if the obviously erroneous for clause is replaced with
> a while clause with the tailing parenthesis also missing, e.g.
> 'while(true', the exact same message is printed.
>
> Panu.
>
>
>
>
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user
>
More information about the aspectc-user
mailing list