public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/64970] New: Hard error instead of SFINAE for expression in nested template alias
@ 2015-02-07 16:15 eric.niebler at gmail dot com
2015-02-08 22:05 ` [Bug c++/64970] " ville.voutilainen at gmail dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: eric.niebler at gmail dot com @ 2015-02-07 16:15 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3621 bytes --]
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64970
Bug ID: 64970
Summary: Hard error instead of SFINAE for expression in nested
template alias
Product: gcc
Version: 4.9.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: eric.niebler at gmail dot com
The following code gives a hard error. I believe it should not.
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;
}
The error:
test.cpp: In substitution of âtemplate<class A, class B> template<class C,
class D> using Inner = decltype ((true ? declval<C>() : declval<D>())) [with C
= A; D = B; A = A; B = B]â:
test.cpp:32:13: required from here
test.cpp:15:33: error: no match for ternary âoperator?:â (operand types are
âboolâ, âAâ, and âBâ)
using Inner = decltype(true ? declval<C>() : declval<D>());
^
>From gcc-bugs-return-476338-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Feb 07 16:39:00 2015
Return-Path: <gcc-bugs-return-476338-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21895 invoked by alias); 7 Feb 2015 16:38:59 -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 21862 invoked by uid 48); 7 Feb 2015 16:38:56 -0000
From: "rv at rasmusvillemoes dot dk" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/64965] __FILE__ doesn't work if the filename contains newline
Date: Sat, 07 Feb 2015 16:38:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: preprocessor
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rv at rasmusvillemoes dot dk
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-64965-4-ayFF3hw7t1@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64965-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64965-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: 2015-02/txt/msg00671.txt.bz2
Content-length: 273
https://gcc.gnu.org/bugzilla/show_bug.cgi?idd965
--- Comment #1 from Rasmus Villemoes <rv at rasmusvillemoes dot dk> ---
Created attachment 34693
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id4693&actioníit
Make __FILE__ work for filenames containing newline
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/64970] Hard error instead of SFINAE for expression in nested template alias
2015-02-07 16:15 [Bug c++/64970] New: Hard error instead of SFINAE for expression in nested template alias eric.niebler at gmail dot com
@ 2015-02-08 22:05 ` ville.voutilainen at gmail dot com
2015-02-13 12:06 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: ville.voutilainen at gmail dot com @ 2015-02-08 22:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64970
Ville Voutilainen <ville.voutilainen at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-02-08
CC| |ville.voutilainen at gmail dot com
Ever confirmed|0 |1
Known to fail| |4.8.2, 4.9.1, 5.0
--- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Clang accepts the code without a hard error.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/64970] Hard error instead of SFINAE for expression in nested template alias
2015-02-07 16:15 [Bug c++/64970] New: Hard error instead of SFINAE for expression in nested template alias eric.niebler at gmail dot com
2015-02-08 22:05 ` [Bug c++/64970] " ville.voutilainen at gmail dot com
@ 2015-02-13 12:06 ` paolo.carlini at oracle dot com
2015-02-13 14:55 ` paolo.carlini at oracle dot com
2015-02-13 14:55 ` paolo at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-02-13 12:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64970
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/64970] Hard error instead of SFINAE for expression in nested template alias
2015-02-07 16:15 [Bug c++/64970] New: Hard error instead of SFINAE for expression in nested template alias eric.niebler at gmail dot com
` (2 preceding siblings ...)
2015-02-13 14:55 ` paolo.carlini at oracle dot com
@ 2015-02-13 14:55 ` paolo at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-02-13 14:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64970
--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Fri Feb 13 14:54:48 2015
New Revision: 220684
URL: https://gcc.gnu.org/viewcvs?rev=220684&root=gcc&view=rev
Log:
/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
* g++.dg/cpp0x/sfinae55.C: New.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/sfinae55.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/64970] Hard error instead of SFINAE for expression in nested template alias
2015-02-07 16:15 [Bug c++/64970] New: Hard error instead of SFINAE for expression in nested template alias eric.niebler at gmail dot com
2015-02-08 22:05 ` [Bug c++/64970] " ville.voutilainen at gmail dot com
2015-02-13 12:06 ` paolo.carlini at oracle dot com
@ 2015-02-13 14:55 ` paolo.carlini at oracle dot com
2015-02-13 14:55 ` paolo at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-02-13 14:55 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64970
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Assignee|paolo.carlini at oracle dot com |unassigned at gcc dot gnu.org
Target Milestone|--- |5.0
Known to fail|5.0 |
--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 5.0.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-02-13 14:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-07 16:15 [Bug c++/64970] New: Hard error instead of SFINAE for expression in nested template alias eric.niebler at gmail dot com
2015-02-08 22:05 ` [Bug c++/64970] " ville.voutilainen at gmail dot com
2015-02-13 12:06 ` paolo.carlini at oracle dot com
2015-02-13 14:55 ` paolo.carlini at oracle dot com
2015-02-13 14:55 ` paolo at gcc dot gnu.org
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).