diff mbox

[4.6] Fix PR53170: missing target c++11 selector

Message ID 4FB9822B.9080805@linaro.org
State New
Headers show

Commit Message

Michael Hope May 20, 2012, 11:45 p.m. UTC
The testsuite for PR52796 uses the 'target c++11' selector which doesn't exist in 4.6.
This patch backports the selector, clearing the 'ERROR: g++.dg/cpp0x/variadic-value1.C:
syntax error in target selector "target c++11" for " dg-do 2 run { target c++11 } "'
errors which have appeared in recent 4.6 builds.

Tested on x86_64-linux-gnu with no regressions.  Changes the ERROR to UNSUPPORTED.

OK for 4.6?

-- Michael

2012-05-21  Michael Hope  <michael.hope@linaro.org>

	PR 53170
	Backport from mainline
	2011-11-08  Jason Merrill  <jason@redhat.com>
	* lib/target-supports.exp (check_effective_target_c++11): New.

Comments

Paolo Carlini May 21, 2012, 9:14 a.m. UTC | #1
On 05/21/2012 01:45 AM, Michael Hope wrote:
> The testsuite for PR52796 uses the 'target c++11' selector which 
> doesn't exist in 4.6.
> This patch backports the selector, clearing the 'ERROR: 
> g++.dg/cpp0x/variadic-value1.C:
> syntax error in target selector "target c++11" for " dg-do 2 run { 
> target c++11 } "'
> errors which have appeared in recent 4.6 builds.
>
> Tested on x86_64-linux-gnu with no regressions.  Changes the ERROR to 
> UNSUPPORTED.
>
> OK for 4.6?
To be honest, when I saw the issue I thought we wanted simply to not use 
the target selector at all in the branch and simply add a // { 
dg-options "-std=c++11" } I thought somebody would commit the change as 
obvious ;)

Paolo.
Fabien Chêne May 21, 2012, 9:49 a.m. UTC | #2
2012/5/21 Paolo Carlini <paolo.carlini@oracle.com>:
> On 05/21/2012 01:45 AM, Michael Hope wrote:
>>
>> The testsuite for PR52796 uses the 'target c++11' selector which doesn't
>> exist in 4.6.
>> This patch backports the selector, clearing the 'ERROR:
>> g++.dg/cpp0x/variadic-value1.C:
>> syntax error in target selector "target c++11" for " dg-do 2 run { target
>> c++11 } "'
>> errors which have appeared in recent 4.6 builds.
>>
>> Tested on x86_64-linux-gnu with no regressions.  Changes the ERROR to
>> UNSUPPORTED.
>>
>> OK for 4.6?
>
> To be honest, when I saw the issue I thought we wanted simply to not use the
> target selector at all in the branch and simply add a // { dg-options
> "-std=c++11" } I thought somebody would commit the change as obvious ;)

Doesn't the target selector c++11 set -pedantic as well ?
Paolo Carlini May 21, 2012, 9:50 a.m. UTC | #3
On 05/21/2012 11:49 AM, Fabien Chêne wrote:
> Doesn't the target selector c++11 set -pedantic as well ? 
You may be right, I didn't check, sorry. Then just add that too, 
wouldn't be the first time.

Paolo.
diff mbox

Patch

=== modified file 'gcc/testsuite/lib/target-supports.exp'
--- gcc/testsuite/lib/target-supports.exp	2012-02-22 17:38:22 +0000
+++ gcc/testsuite/lib/target-supports.exp	2012-05-18 01:57:51 +0000
@@ -3822,6 +3822,17 @@ 
   return 0
  }

+# Check which language standard is active by checking for the presence of
+# one of the C++11 -std flags.  This assumes that the default for the
+# compiler is C++98, and that there will never be multiple -std= arguments
+# on the command line.
+proc check_effective_target_c++11 { } {
+    if ![check_effective_target_c++] {
+	return 0
+    }
+    return [check-flags { { } { } { -std=c++0x -std=gnu++0x -std=c++11 -std=gnu++11 } }]
+}
+
  # Return 1 if the language for the compiler under test is C++.

  proc check_effective_target_c++ { } {