Opened 8 weeks ago
#271 new defect
Compiler crash on valid typename--identifier pun
Reported by: | mlbrooks | Owned by: | |
---|---|---|---|
Priority: | minor | Component: | cfa-cc |
Version: | 1.0 | Keywords: | |
Cc: |
Description
This program tries to use s
as both a typename and an identifier (the parameter to function f
).
#ifndef __cforall__ extern "C" int printf(const char*, ...); #endif struct s { float item; }; void f( s s ) { printf( "%.2f\n", s.item); } // at issue void g( s ess ) { printf( "%.2f\n", ess.item); } // for comparison, works fine int main( int argc, char ** argv ) { s thing = { 3.14 }; f(thing); g(thing); }
ACTUAL: cfa-cpp segment faults during Validate::fixQualifiedTypes
EXPECTED: compiles successfully; running prints "3.14" twice
Expectation is justified by "works in C++":
$ g++ -xc++ demo.cfa $ ./a.out 3.14 3.14
Note: See
TracTickets for help on using
tickets.