diff options
Diffstat (limited to 'gcc/ada/sem_prag.adb')
| -rw-r--r-- | gcc/ada/sem_prag.adb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index b856bad..c266e2d 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -5060,12 +5060,15 @@ package body Sem_Prag is Analyze_And_Resolve (Expr); end if; - if Is_OK_Static_Expression (Expr) then - return; + -- An expression cannot be considered static if its resolution failed + -- or if it erroneous. Stop the analysis of the related pragma. - elsif Etype (Expr) = Any_Type then + if Etype (Expr) = Any_Type or else Error_Posted (Expr) then raise Pragma_Exit; + elsif Is_OK_Static_Expression (Expr) then + return; + -- An interesting special case, if we have a string literal and we -- are in Ada 83 mode, then we allow it even though it will not be -- flagged as static. This allows the use of Ada 95 pragmas like @@ -5077,12 +5080,6 @@ package body Sem_Prag is then return; - -- Static expression that raises Constraint_Error. This has already - -- been flagged, so just exit from pragma processing. - - elsif Is_OK_Static_Expression (Expr) then - raise Pragma_Exit; - -- Finally, we have a real error else |
