* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
@ 2012-04-04 13:56 ` paolo.carlini at oracle dot com
2012-04-20 2:10 ` paolo.carlini at oracle dot com
` (20 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-04-04 13:56 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |paolo.carlini at oracle dot
| |com
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-04-04 13:55:58 UTC ---
*** Bug 52826 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
2012-04-04 13:56 ` [Bug c++/51213] " paolo.carlini at oracle dot com
@ 2012-04-20 2:10 ` paolo.carlini at oracle dot com
2012-04-27 1:33 ` jyasskin at gcc dot gnu.org
` (19 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-04-20 2:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2012-04-20
CC|paolo.carlini at oracle dot |
|com |
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
Target Milestone|--- |4.8.0
Ever Confirmed|0 |1
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-04-20 02:08:51 UTC ---
I think I can handle this.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
2012-04-04 13:56 ` [Bug c++/51213] " paolo.carlini at oracle dot com
2012-04-20 2:10 ` paolo.carlini at oracle dot com
@ 2012-04-27 1:33 ` jyasskin at gcc dot gnu.org
2012-04-27 9:27 ` paolo.carlini at oracle dot com
` (18 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: jyasskin at gcc dot gnu.org @ 2012-04-27 1:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #3 from Jeffrey Yasskin <jyasskin at gcc dot gnu.org> 2012-04-27 01:31:49 UTC ---
This looks like the root cause. along with r174464, of a regression in C++11
mode from 4.6->4.7 on the following program:
$ cat test.cc
#include <utility>
class Uncopyable { // 2
Uncopyable(const Uncopyable&); // 3
public:
Uncopyable() = default;
};
struct ContainsUncopyable {
std::pair<Uncopyable, int> pv; // 8
};
void foo() {
ContainsUncopyable c; // 11
}
$ ~/gcc-4.6-svn/bin/g++-4.6pre --version
g++-4.6pre (GCC) 4.6.4 20120412 (prerelease)
$ g++-4.6pre -c -std=c++0x test.cc
$ ~/gcc-4.7-svn/bin/g++-4.7pre --version
g++-4.7pre (GCC) 4.7.1 20120412 (prerelease)
$ g++-4.7pre -c -std=c++11 test.cc
.../include/c++/4.7.1/type_traits: In substitution of ‘template<class _From1,
class _To1> static decltype ((__test_aux<_To1>(declval<_From1>()), std::__s
finae_types::__one())) std::__is_convertible_helper<_From, _To,
false>::__test(int) [with _From1 = _From1; _To1 = _To1; _From = const
Uncopyable&; _To = Uncopyable] [with _From1 = const Uncopyable&; _To1 =
Uncopyable]’:
.../include/c++/4.7.1/type_traits:1258:70: required from ‘constexpr const
bool std::__is_convertible_helper<const Uncopyable&, Uncopyable, false>::valu
e’
.../include/c++/4.7.1/type_traits:1263:12: required from ‘struct
std::is_convertible<const Uncopyable&, Uncopyable>’
.../include/c++/4.7.1/type_traits:116:12: required from ‘struct
std::__and_<std::is_convertible<const Uncopyable&, Uncopyable>,
std::is_convertible<con
st int&, int> >’
.../include/c++/4.7.1/bits/stl_pair.h:113:38: required from here
test.cc:3:3: error: ‘Uncopyable::Uncopyable(const Uncopyable&)’ is private
In file included from .../include/c++/4.7.1/bits/move.h:57:0,
from .../include/c++/4.7.1/bits/stl_pair.h:61,
from .../include/c++/4.7.1/utility:72,
from test.cc:1:
.../include/c++/4.7.1/type_traits:1252:2: error: within this context
...
The workaround is to use =delete instead of access control to create
non-copyable classes in C++11 mode.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (2 preceding siblings ...)
2012-04-27 1:33 ` jyasskin at gcc dot gnu.org
@ 2012-04-27 9:27 ` paolo.carlini at oracle dot com
2012-06-20 19:10 ` redi at gcc dot gnu.org
` (17 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-04-27 9:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-04-27 09:26:39 UTC ---
Yes, in a few areas the 4.7.x library is much closer to the letter of C++11 in
terms of constraining, and of course we never did access control under sfinae.
Note that the latter, being a new feature, is very likely to happen only in
4.8, but not in 4.7.x, I don't think however we may want to take out
constraining from the 4.7.x library (indeed, people are normally encouraged to
use deleted members, not access control, together with "classic" sfinae)
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (3 preceding siblings ...)
2012-04-27 9:27 ` paolo.carlini at oracle dot com
@ 2012-06-20 19:10 ` redi at gcc dot gnu.org
2012-07-19 1:38 ` jason at gcc dot gnu.org
` (16 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: redi at gcc dot gnu.org @ 2012-06-20 19:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |maxdebayser at gmail dot
| |com
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-06-20 19:08:41 UTC ---
*** Bug 53734 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (4 preceding siblings ...)
2012-06-20 19:10 ` redi at gcc dot gnu.org
@ 2012-07-19 1:38 ` jason at gcc dot gnu.org
2012-07-19 2:06 ` jason at gcc dot gnu.org
` (15 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: jason at gcc dot gnu.org @ 2012-07-19 1:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2012-07-19 01:36:55 UTC ---
Author: jason
Date: Thu Jul 19 01:36:50 2012
New Revision: 189639
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189639
Log:
DR 1170
PR c++/51213
* semantics.c (perform_access_checks): Add complain parm, return bool.
(perform_deferred_access_checks): Likewise.
(perform_or_defer_access_check): Likewise.
(speculative_access_check): Remove.
* call.c (enforce_access): Add complain parm, return bool.
* decl.c, friend.c, class.c, init.c, parser.c: Adjust callers.
* search.c: Adjust callers.
* cp-tree.h (TINFO_RECHECK_ACCESS_P): New macro.
(FNDECL_RECHECK_ACCESS_P): New macro.
* method.c (synthesized_method_walk): Stop deferring access checks.
* pt.c (recheck_decl_substitution): New.
(instantiate_template_1): Set and check FNDECL_RECHECK_ACCESS_P.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/sfinae37.C
trunk/gcc/testsuite/g++.dg/template/access23.C
trunk/libstdc++-v3/testsuite/20_util/pair/noncopyable.cc
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/class.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/decl.c
trunk/gcc/cp/friend.c
trunk/gcc/cp/init.c
trunk/gcc/cp/method.c
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/search.c
trunk/gcc/cp/semantics.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/template/access7.C
trunk/gcc/testsuite/g++.dg/template/sfinae10.C
trunk/gcc/testsuite/g++.dg/template/sfinae6_neg.C
trunk/libstdc++-v3/ChangeLog
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (5 preceding siblings ...)
2012-07-19 1:38 ` jason at gcc dot gnu.org
@ 2012-07-19 2:06 ` jason at gcc dot gnu.org
2012-07-23 21:02 ` daniel.kruegler at googlemail dot com
` (14 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: jason at gcc dot gnu.org @ 2012-07-19 2:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2012-07-19 02:05:00 UTC ---
Fixed for 4.8.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (6 preceding siblings ...)
2012-07-19 2:06 ` jason at gcc dot gnu.org
@ 2012-07-23 21:02 ` daniel.kruegler at googlemail dot com
2012-07-23 23:36 ` paolo.carlini at oracle dot com
` (13 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2012-07-23 21:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
--- Comment #8 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2012-07-23 21:01:09 UTC ---
I agree that the actual test examples work now, but I also found that only
*slight* variations of the call context of the test expression
"sizeof(f<C>(0))" again lead to access errors. The following variants
demonstrate this:
//---
class C {
typedef int type; // Line 2
};
template<class T, class = typename T::type>
auto f(int) -> char;
template<class>
auto f(...) -> char (&)[2];
static_assert(sizeof(f<C>(0)) == 2, ""); // OK
typedef int test[sizeof(f<C>(0)) == 2 ? 1 : -1]; // Error
template<int>
struct I {};
I<sizeof(f<C>(0))> i; // Error
enum E { e1 = sizeof(f<C>(0)) }; // Error
//---
"13|error: size of array 'test' is negative|
2|error: 'typedef int C::type' is private|
5|error: within this context|
2|error: 'typedef int C::type' is private|
18|error: within this context|
2|error: 'typedef int C::type' is private|
5|error: within this context|
"
Jason suggested to reopen the issue, so I did.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (7 preceding siblings ...)
2012-07-23 21:02 ` daniel.kruegler at googlemail dot com
@ 2012-07-23 23:36 ` paolo.carlini at oracle dot com
2012-07-24 10:35 ` paolo.carlini at oracle dot com
` (12 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-07-23 23:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-07-23 23:35:42 UTC ---
Weird indeed, thanks Daniel. Tomorrow I will have a look and either will send a
patch or will post an analysis (if I will get stuck).
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (8 preceding siblings ...)
2012-07-23 23:36 ` paolo.carlini at oracle dot com
@ 2012-07-24 10:35 ` paolo.carlini at oracle dot com
2012-08-02 18:46 ` paolo at gcc dot gnu.org
` (11 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-07-24 10:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-07-24 10:34:56 UTC ---
So, first we have a typo at pt.c:6142:
orig_arg = make_typename_type (TREE_OPERAND (arg, 0),
TREE_OPERAND (arg, 1),
typename_type,
complain & tf_error);
the fourth argument must be just complain. Let's see if we have more ;)
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (9 preceding siblings ...)
2012-07-24 10:35 ` paolo.carlini at oracle dot com
@ 2012-08-02 18:46 ` paolo at gcc dot gnu.org
2012-08-02 19:38 ` paolo.carlini at oracle dot com
` (10 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: paolo at gcc dot gnu.org @ 2012-08-02 18:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #11 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2012-08-02 18:45:04 UTC ---
Author: paolo
Date: Thu Aug 2 18:44:58 2012
New Revision: 190093
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190093
Log:
/cp
2012-08-02 Jason Merrill <jason@redhat.com>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51213 (again)
* pt.c (type_unification_real): Call push_deferring_access_checks /
pop_deferring_access_checks around the substitution of default
template args.
(instantiate_template_1): When the specialization returned by
retrieve_specialization has FNDECL_HAS_ACCESS_ERRORS set and we
are in a SFINAE context, simply return error_mark_node.
* cp-tree.h (FNDECL_RECHECK_ACCESS_P): Rename FNDECL_HAS_ACCESS_ERRORS.
/testsuite
2012-08-02 Jason Merrill <jason@redhat.com>
Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51213 (again)
* g++.dg/cpp0x/sfinae37.C: Extend.
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/cpp0x/sfinae37.C
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (10 preceding siblings ...)
2012-08-02 18:46 ` paolo at gcc dot gnu.org
@ 2012-08-02 19:38 ` paolo.carlini at oracle dot com
2012-08-25 3:31 ` jason at gcc dot gnu.org
` (9 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-08-02 19:38 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
--- Comment #12 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-02 19:37:23 UTC ---
I guess we can close again.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (11 preceding siblings ...)
2012-08-02 19:38 ` paolo.carlini at oracle dot com
@ 2012-08-25 3:31 ` jason at gcc dot gnu.org
2012-08-31 12:58 ` markus at trippelsdorf dot de
` (8 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: jason at gcc dot gnu.org @ 2012-08-25 3:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> 2012-08-25 03:30:16 UTC ---
Author: jason
Date: Sat Aug 25 03:30:11 2012
New Revision: 190664
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190664
Log:
PR c++/51213 (again)
* pt.c (deduction_tsubst_fntype): Remove.
(fn_type_unification): Check deduction depth and call
instantiate_template here. Handle default argument access checks.
(determine_specialization): Suppress access control.
(tsubst_decl): Check for excessive deduction depth.
(recheck_decl_substitution): Make sure access control is on.
(type_unification_real): Don't mess with access deferring here.
(get_bindings): Adjust for fn_type_unification return type.
* call.c (enum rejection_reason_code): Drop rr_template_instantiation.
(template_instantiation_rejection): Remove.
(struct rejection_reason): Change targs to num_targs.
(template_unification_rejection, print_z_candidate): Adjust.
(add_template_candidate_real): Adjust for fn_type_unification change.
* class.c (resolve_address_of_overloaded_function): Likewise.
* cp-tree.h: Adjust declaration.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/class.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/pt.c
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (12 preceding siblings ...)
2012-08-25 3:31 ` jason at gcc dot gnu.org
@ 2012-08-31 12:58 ` markus at trippelsdorf dot de
2012-09-04 18:51 ` jason at gcc dot gnu.org
` (7 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: markus at trippelsdorf dot de @ 2012-08-31 12:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
Markus Trippelsdorf <markus at trippelsdorf dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |markus at trippelsdorf dot
| |de
--- Comment #14 from Markus Trippelsdorf <markus at trippelsdorf dot de> 2012-08-31 12:57:07 UTC ---
(In reply to comment #13)
> Author: jason
> Date: Sat Aug 25 03:30:11 2012
> New Revision: 190664
>
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190664
> Log:
> PR c++/51213 (again)
This revision causes Bug 54437.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (13 preceding siblings ...)
2012-08-31 12:58 ` markus at trippelsdorf dot de
@ 2012-09-04 18:51 ` jason at gcc dot gnu.org
2013-06-23 20:28 ` w.shane.grant at gmail dot com
` (6 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: jason at gcc dot gnu.org @ 2012-09-04 18:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #15 from Jason Merrill <jason at gcc dot gnu.org> 2012-09-04 18:50:03 UTC ---
Author: jason
Date: Tue Sep 4 18:49:51 2012
New Revision: 190946
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=190946
Log:
PR c++/54437
PR c++/51213
* pt.c (fn_type_unification): Call coerce_template_parms before
entering substitution context.
Added:
trunk/gcc/testsuite/g++.dg/template/access24.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (14 preceding siblings ...)
2012-09-04 18:51 ` jason at gcc dot gnu.org
@ 2013-06-23 20:28 ` w.shane.grant at gmail dot com
2013-06-23 22:05 ` paolo.carlini at oracle dot com
` (5 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: w.shane.grant at gmail dot com @ 2013-06-23 20:28 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
Shane <w.shane.grant at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |w.shane.grant at gmail dot com
--- Comment #16 from Shane <w.shane.grant at gmail dot com> ---
I think some variant of this bug may still exist (using g++ (Ubuntu
4.8.1-2ubuntu1~13.04) 4.8.1). The following code will fail to compile under
g++ but will correctly compile under a recent version of clang++ (3.3).
template <class T>
T && declval();
template <class T>
constexpr auto hasSize(int) -> decltype(declval<T&>().size(), bool())
{ return true; }
template <class T>
constexpr bool hasSize(...)
{ return false; }
struct A
{
int size();
};
struct B : private A
{
};
static_assert(hasSize<A>(0), "A");
static_assert(!hasSize<B>(0), "B");
int main() {}
The error produced is:
test.cpp: In substitution of ‘template<class T> constexpr decltype
((declval<T&>().size(), bool())) hasSize(int) [with T = B]’:
test.cpp:22:28: required from here
test.cpp:5:61: error: ‘A’ is not an accessible base of ‘B’
constexpr auto hasSize(int) -> decltype(declval<T&>().size(), bool())
^
test.cpp: In substitution of ‘template<class T> constexpr decltype
((declval<T&>().size(), bool())) hasSize(int) [with T = B]’:
test.cpp:22:28: required from here
test.cpp:5:61: error: ‘A’ is not an accessible base of ‘B’
>From gcc-bugs-return-424942-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jun 23 20:38:19 2013
Return-Path: <gcc-bugs-return-424942-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 6240 invoked by alias); 23 Jun 2013 20:38:19 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 6211 invoked by uid 48); 23 Jun 2013 20:38:16 -0000
From: "janus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/57639] [OOP] ICE with polymorphism (and illegal code)
Date: Sun, 23 Jun 2013 20:38:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: janus at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: janus at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57639-4-xgUUA1IYza@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-57639-4@http.gcc.gnu.org/bugzilla/>
References: <bug-57639-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-06/txt/msg01321.txt.bz2
Content-length: 207
http://gcc.gnu.org/bugzilla/show_bug.cgi?idW639
--- Comment #4 from janus at gcc dot gnu.org ---
(In reply to janus from comment #3)
> The following patch fixes both variants:
... and regtests cleanly.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (15 preceding siblings ...)
2013-06-23 20:28 ` w.shane.grant at gmail dot com
@ 2013-06-23 22:05 ` paolo.carlini at oracle dot com
2014-10-22 5:29 ` mizvekov at gmail dot com
` (4 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-06-23 22:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #17 from Paolo Carlini <paolo.carlini at oracle dot com> ---
But this example works in mainline (would be 4.9.0) and I don't think it's a
regression.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (16 preceding siblings ...)
2013-06-23 22:05 ` paolo.carlini at oracle dot com
@ 2014-10-22 5:29 ` mizvekov at gmail dot com
2014-10-22 6:39 ` mizvekov at gmail dot com
` (3 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: mizvekov at gmail dot com @ 2014-10-22 5:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
Matheus Izvekov <mizvekov at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mizvekov at gmail dot com
--- Comment #18 from Matheus Izvekov <mizvekov at gmail dot com> ---
Created attachment 33776
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33776&action=edit
CWG 1170 test case
Compile with "g++ -std=c++11 -DPUB=0 test.cc" and it should print 'false'
Compile with "g++ -std=c++11 -DPUB=1 test.cc" and it should print 'true'.
Instead, GCC 4.9.1 prints true in both cases.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (17 preceding siblings ...)
2014-10-22 5:29 ` mizvekov at gmail dot com
@ 2014-10-22 6:39 ` mizvekov at gmail dot com
2014-10-22 9:01 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
21 siblings, 0 replies; 23+ messages in thread
From: mizvekov at gmail dot com @ 2014-10-22 6:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #19 from Matheus Izvekov <mizvekov at gmail dot com> ---
CWG 1170 is still not correctly implemented as of gcc 4.9.1
The attached test shows just this.
Compile it with
"g++ -std=c++11 -DPUB=0 test.cc" and
"g++ -std=c++11 -DPUB=1 test.cc".
The one with PUB=0 should print 'false', while the one with PUB=1 should print
'true'.
The test works as expected with clang 3.5.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (18 preceding siblings ...)
2014-10-22 6:39 ` mizvekov at gmail dot com
@ 2014-10-22 9:01 ` paolo.carlini at oracle dot com
2014-10-22 9:24 ` paolo.carlini at oracle dot com
2014-10-22 9:30 ` mizvekov at gmail dot com
21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-10-22 9:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #20 from Paolo Carlini <paolo.carlini at oracle dot com> ---
This is already fixed in mainline, though. I'm adding the testcase.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (19 preceding siblings ...)
2014-10-22 9:01 ` paolo.carlini at oracle dot com
@ 2014-10-22 9:24 ` paolo.carlini at oracle dot com
2014-10-22 9:30 ` mizvekov at gmail dot com
21 siblings, 0 replies; 23+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-10-22 9:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #21 from Paolo Carlini <paolo.carlini at oracle dot com> ---
As a matter of fact, I can't reproduce the issue with 4.9.1.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [Bug c++/51213] [C++11][DR 1170] Access control checking has to be done under SFINAE conditions
2011-11-18 20:10 [Bug c++/51213] New: [C++11][DR 1170] Access control checking has to be done under SFINAE conditions daniel.kruegler at googlemail dot com
` (20 preceding siblings ...)
2014-10-22 9:24 ` paolo.carlini at oracle dot com
@ 2014-10-22 9:30 ` mizvekov at gmail dot com
21 siblings, 0 replies; 23+ messages in thread
From: mizvekov at gmail dot com @ 2014-10-22 9:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213
--- Comment #22 from Matheus Izvekov <mizvekov at gmail dot com> ---
Apologies, it was a problem on my end!
The fault was just clang and gcc having different default binary names on msys,
'a.out' vs 'a.exe', and me using a stale exe when testing gcc...
Sorry!
^ permalink raw reply [flat|nested] 23+ messages in thread