summaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-04 14:27:40 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-04 14:27:40 +0200
commit2d395256d71921f464153393f04ef688f1eab209 (patch)
treea3bcc1e0922a6c48a52bb1cc07887f3708bf41c7 /gcc/ada/par-ch4.adb
parent767ab2fde8deb8a34866897bd3d6b07b43e366bd (diff)
downloadgcc-2d395256d71921f464153393f04ef688f1eab209.tar.gz
[multiple changes]
2011-08-04 Yannick Moy <moy@adacore.com> * par-ch4.adb (P_Primary): preferentially issue an error message about a missing parenthesis arount a conditional or case expression in Ada 2012 mode, if we detect that the alignment is not correct for a statement. 2011-08-04 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Process_Declarations): Do not consider the result of a tag-to-class-wide conversion as needing finalization actions. * exp_util.adb (Has_Controlled_Objects): Do not consider the result of a tag-to-class-wide conversion as needing finalization actions. (Is_Finalizable_Transient): The result of a tag-to-class-wide conversion does not need finalization actions. (Is_Tag_To_CW_Conversion): New routine. * exp_util.ads (Is_Tag_To_CW_Conversion): New routine. Determines whether an object is the result of a tag-to-class-wide conversion. 2011-08-04 Yannick Moy <moy@adacore.com> * sem_ch13.adb (Analyze_Aspect_Specifications): correct order in which the left-hand-side and right-hand-side of a conjunct are inserted when translating a pre- or postcondition * sem_ch6.adb: Correct typo in comment 2011-08-04 Ed Schonberg <schonberg@adacore.com> * gnat_rm.texi: Ravenscar does not prohibit dependence on Unchecked_Conversion and Unchecked_Deallocation. 2011-08-04 Thomas Quinot <quinot@adacore.com> * make.adb: Minor reformatting. From-SVN: r177371
Diffstat (limited to 'gcc/ada/par-ch4.adb')
-rw-r--r--gcc/ada/par-ch4.adb26
1 files changed, 20 insertions, 6 deletions
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index f2fc7654108..125a9c4a1e0 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -2445,9 +2445,16 @@ package body Ch4 is
-- If this looks like a real if, defined as an IF appearing at
-- the start of a new line, then we consider we have a missing
- -- operand.
-
- if Token_Is_At_Start_Of_Line then
+ -- operand. If in Ada 2012 and the IF is not properly indented
+ -- for a statement, we prefer to issue a message about an ill-
+ -- parenthesized conditional expression.
+
+ if Token_Is_At_Start_Of_Line
+ and then not
+ (Ada_Version >= Ada_2012
+ and then Style_Check_Indentation /= 0
+ and then Start_Column rem Style_Check_Indentation /= 0)
+ then
Error_Msg_AP ("missing operand");
return Error;
@@ -2471,9 +2478,16 @@ package body Ch4 is
-- If this looks like a real case, defined as a CASE appearing
-- the start of a new line, then we consider we have a missing
- -- operand.
-
- if Token_Is_At_Start_Of_Line then
+ -- operand. If in Ada 2012 and the CASE is not properly
+ -- indented for a statement, we prefer to issue a message about
+ -- an ill-parenthesized case expression.
+
+ if Token_Is_At_Start_Of_Line
+ and then not
+ (Ada_Version >= Ada_2012
+ and then Style_Check_Indentation /= 0
+ and then Start_Column rem Style_Check_Indentation /= 0)
+ then
Error_Msg_AP ("missing operand");
return Error;