From patchwork Fri Nov 16 09:30:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2,testsuite] : Add dg-error for unsupported floating suffix From: Uros Bizjak X-Patchwork-Id: 199526 Message-Id: To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Date: Fri, 16 Nov 2012 10:30:18 +0100 On Fri, Nov 16, 2012 at 9:52 AM, Jakub Jelinek wrote: >> 2012-11-16 Uros Bizjak >> >> * lib/target_suports.exp >> (check_effective_target_has_w_floating_suffix): New procedure. >> (check_effective_target_has_q_floating_suffix): Ditto. >> * g++.dg/cpp0x/gnu_fext-numeric-literals.C: Add dg-error directive >> for unsupported non-standard suffix on floating constant. >> * g++.dg/cpp0x/std_fext-numeric-literals.C: Ditto. >> >> Attached patch was re-tested on alphaev68-linux-gnu and >> x86_64-linux-gnu and committed to mainline SVN. > > Perhaps just bike-shed, but I'd write it as: Actually, a very good idea! I will commit the following addendum when alpha finishes testing: --cut here-- --cut here-- Thanks, Uros. Index: target-supports.exp =================================================================== --- target-supports.exp (revision 193551) +++ target-supports.exp (working copy) @@ -1746,18 +1746,26 @@ # 0 otherwise. proc check_effective_target_has_w_floating_suffix { } { + set opts "" + if [check_effective_target_c++] { + append opts "-std=gnu++03" + } return [check_no_compiler_messages w_fp_suffix object { float dummy = 1.0w; - } "-std=gnu++03 -w"] + } "$opts"] } # Return 1 if the target supports 'q' suffix on floating constant # 0 otherwise. proc check_effective_target_has_q_floating_suffix { } { + set opts "" + if [check_effective_target_c++] { + append opts "-std=gnu++03" + } return [check_no_compiler_messages q_fp_suffix object { float dummy = 1.0q; - } "-std=gnu++03 -w"] + } "$opts"] } # Return 1 if the target supports compiling fixed-point, # 0 otherwise.