Patchwork [v2,testsuite] : Add dg-error for unsupported floating suffix

login
register
mail settings
Submitter Uros Bizjak
Date Nov. 16, 2012, 9:30 a.m.
Message ID <CAFULd4ZVsBouqS=uKNDZApEyH+o6dSg6hLjeyZLUSLz45Fhm3A@mail.gmail.com>
Download mbox | patch
Permalink /patch/199526/
State New
Headers show

Comments

Uros Bizjak - Nov. 16, 2012, 9:30 a.m.
On Fri, Nov 16, 2012 at 9:52 AM, Jakub Jelinek <jakub@redhat.com> wrote:

>> 2012-11-16  Uros Bizjak  <ubizjak@gmail.com>
>>
>>       * 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.

Patch

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.