2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr55740.C
blob9597c28f965456ffa743814358fc742fadbb5aa9
1 // { dg-do compile }
3 static bool st_IsPathDelimiter( char c ) { return c == '/'; }
4 bool IsValidPath( char const * filename )
6   if ( !filename || filename[0] == 0 )     
7     return false;
8   char const * run = filename;
9   while ( run && *run )       
10     {
11       if ( run[0] == '.' )   
12         if ( run[1] != '.' || ( !st_IsPathDelimiter( run[2] ) && run[2] != 0 ) )   
13           return false;   
14       while ( *run && !st_IsPathDelimiter( *run ) )
15         ++run;
16       if ( *run ) 
17         ++run;
18     }
19 }       // { dg-warning "control reaches end of non-void function" }