* [C++ Patch] PR 64970
@ 2015-02-13 13:09 Paolo Carlini
2015-02-13 14:36 ` Jason Merrill
0 siblings, 1 reply; 2+ messages in thread
From: Paolo Carlini @ 2015-02-13 13:09 UTC (permalink / raw)
To: gcc-patches; +Cc: jason Merrill
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
Hi,
this one seems a typical very simple SFINAE issue, where we are not
correctly forwarding the tsubst_flags_t argument. Not sure if we are
still in time for 5.0...
Tested x86_64-linux.
Thanks,
Paolo.
///////////////////////
[-- Attachment #2: CL_64970 --]
[-- Type: text/plain, Size: 285 bytes --]
/cp
2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/64970
* decl.c (make_typename_type): Pass tsubst_flags_t argument
to lookup_template_class.
/testsuite
2015-02-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/64970
* testsuite/g++.dg/cpp0x/sfinae55.C: New.
[-- Attachment #3: patch_64970 --]
[-- Type: text/plain, Size: 1334 bytes --]
Index: cp/decl.c
===================================================================
--- cp/decl.c (revision 220679)
+++ cp/decl.c (working copy)
@@ -3569,7 +3569,7 @@ make_typename_type (tree context, tree name, enum
return lookup_template_class (t, TREE_OPERAND (fullname, 1),
NULL_TREE, context,
/*entering_scope=*/0,
- tf_warning_or_error | tf_user);
+ complain | tf_user);
if (DECL_ARTIFICIAL (t) || !(complain & tf_keep_type_decl))
t = TREE_TYPE (t);
Index: testsuite/g++.dg/cpp0x/sfinae55.C
===================================================================
--- testsuite/g++.dg/cpp0x/sfinae55.C (revision 0)
+++ testsuite/g++.dg/cpp0x/sfinae55.C (working copy)
@@ -0,0 +1,33 @@
+// PR c++/64970
+// { dg-do compile { target c++11 } }
+
+template<typename T>
+T && declval();
+
+template<typename T>
+struct void_ { using type = void; };
+
+template<typename T>
+using void_t = typename void_<T>::type;
+
+template<class A, class B>
+struct Outer
+{
+ template<class C, class D>
+ using Inner = decltype(true ? declval<C>() : declval<D>());
+};
+
+template<class A, class B, typename Enable = void>
+struct S
+{};
+
+template<class A, class B>
+struct S<A, B, void_t<typename Outer<A, B>::template Inner<A, B>>>
+{};
+
+struct A{};
+struct B{};
+int main()
+{
+ S<A, B> s;
+}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [C++ Patch] PR 64970
2015-02-13 13:09 [C++ Patch] PR 64970 Paolo Carlini
@ 2015-02-13 14:36 ` Jason Merrill
0 siblings, 0 replies; 2+ messages in thread
From: Jason Merrill @ 2015-02-13 14:36 UTC (permalink / raw)
To: Paolo Carlini, gcc-patches
OK.
Jason
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-13 14:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-13 13:09 [C++ Patch] PR 64970 Paolo Carlini
2015-02-13 14:36 ` Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).