public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61370] New: decltype, enable_if, previous arguments
@ 2014-05-30 15:14 patrick.a.moran at gmail dot com
  2014-05-30 19:47 ` [Bug c++/61370] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: patrick.a.moran at gmail dot com @ 2014-05-30 15:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61370

            Bug ID: 61370
           Summary: decltype, enable_if, previous arguments
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: patrick.a.moran at gmail dot com

Created attachment 32878
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32878&action=edit
minimal reproduction

SFINAE that depednds on the decltype of a previous argument fails to funciton
in a member function if the definition is external to the class.  The
out-of-class definition is reported as having a prototype that does not match
any in the class.

In the attached test case you can see the error.  If you define WORKAROUND, you
will see the same code with the definition moved into the class and the error
will not recur.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/61370] decltype, enable_if, previous arguments
  2014-05-30 15:14 [Bug c++/61370] New: decltype, enable_if, previous arguments patrick.a.moran at gmail dot com
@ 2014-05-30 19:47 ` redi at gcc dot gnu.org
  2014-05-30 20:09 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2014-05-30 19:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61370

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-05-30
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
That code causes an ICE on trunk:

/var/tmp/bug_report.cpp:39:60: internal compiler error: canonical types differ
for identical types eif<same<decltype (a), int&&>::value> and eif<same<decltype
(a), int&&>::value>
      typename eif<same<decltype(a), int&&>::value>::type * )
                                                            ^
0x699b99 comptypes
        /home/jwakely/src/gcc/gcc/gcc/cp/typeck.c:1403
0x6980cd structural_comptypes
        /home/jwakely/src/gcc/gcc/gcc/cp/typeck.c:1319
0x697bbc structural_comptypes
        /home/jwakely/src/gcc/gcc/gcc/cp/typeck.c:1337
0x69d243 compparms(tree_node const*, tree_node const*)
        /home/jwakely/src/gcc/gcc/gcc/cp/typeck.c:1514
0x63331a check_classfn(tree_node*, tree_node*, tree_node*)
        /home/jwakely/src/gcc/gcc/gcc/cp/decl2.c:705
0x4fccc0 grokfndecl
        /home/jwakely/src/gcc/gcc/gcc/cp/decl.c:7810
0x59a012 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        /home/jwakely/src/gcc/gcc/gcc/cp/decl.c:10823
0x59ae36 start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
        /home/jwakely/src/gcc/gcc/gcc/cp/decl.c:13519
0x67f46f cp_parser_function_definition_from_specifiers_and_declarator
        /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:22802
0x67f46f cp_parser_init_declarator
        /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:16646
0x681044 cp_parser_single_declaration
        /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:23254
0x6823a0 cp_parser_template_declaration_after_export
        /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:23056
0x68cdf9 cp_parser_declaration
        /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:10991
0x68b98d cp_parser_declaration_seq_opt
        /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:10913
0x68d1f3 cp_parser_translation_unit
        /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:4040
0x68d1f3 c_parse_file()
        /home/jwakely/src/gcc/gcc/gcc/cp/parser.c:31698
0x7b8164 c_common_parse_file()
        /home/jwakely/src/gcc/gcc/gcc/c-family/c-opts.c:1067


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/61370] decltype, enable_if, previous arguments
  2014-05-30 15:14 [Bug c++/61370] New: decltype, enable_if, previous arguments patrick.a.moran at gmail dot com
  2014-05-30 19:47 ` [Bug c++/61370] " redi at gcc dot gnu.org
@ 2014-05-30 20:09 ` paolo.carlini at oracle dot com
  2014-05-30 20:12 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-05-30 20:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61370

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Seems closely related to c++/58230


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/61370] decltype, enable_if, previous arguments
  2014-05-30 15:14 [Bug c++/61370] New: decltype, enable_if, previous arguments patrick.a.moran at gmail dot com
  2014-05-30 19:47 ` [Bug c++/61370] " redi at gcc dot gnu.org
  2014-05-30 20:09 ` paolo.carlini at oracle dot com
@ 2014-05-30 20:12 ` paolo.carlini at oracle dot com
  2014-06-23 14:51 ` patrick.a.moran at gmail dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-05-30 20:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61370

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
I meant c++/52830


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/61370] decltype, enable_if, previous arguments
  2014-05-30 15:14 [Bug c++/61370] New: decltype, enable_if, previous arguments patrick.a.moran at gmail dot com
                   ` (2 preceding siblings ...)
  2014-05-30 20:12 ` paolo.carlini at oracle dot com
@ 2014-06-23 14:51 ` patrick.a.moran at gmail dot com
  2014-06-23 17:10 ` redi at gcc dot gnu.org
  2014-06-23 17:43 ` patrick.a.moran at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: patrick.a.moran at gmail dot com @ 2014-06-23 14:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61370

--- Comment #4 from Patrick Moran <patrick.a.moran at gmail dot com> ---
This bug does indeed seem to be related to / duplicate of c++/52830.  That is,
the two bugs reports are referring to the same trigger, but the bug manifests
differently in the two versions (in the 4.9.0 I tested, I got this error, in
the 4.8.0 it tested they got ICE).  When I built c++/52830's test case with
4.9.0, I got this error message.

A bit unsure of the ettiquette here - as the original reporter is it
appropriate for me to go ahead and mark this ticket dup?


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/61370] decltype, enable_if, previous arguments
  2014-05-30 15:14 [Bug c++/61370] New: decltype, enable_if, previous arguments patrick.a.moran at gmail dot com
                   ` (3 preceding siblings ...)
  2014-06-23 14:51 ` patrick.a.moran at gmail dot com
@ 2014-06-23 17:10 ` redi at gcc dot gnu.org
  2014-06-23 17:43 ` patrick.a.moran at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2014-06-23 17:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61370

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Patrick Moran from comment #4)
> A bit unsure of the ettiquette here - as the original reporter is it
> appropriate for me to go ahead and mark this ticket dup?

yes, if you're sure it's the same issue

maybe add the testcase from this bug to the other ticket so it can be checked
when a fix is tested


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/61370] decltype, enable_if, previous arguments
  2014-05-30 15:14 [Bug c++/61370] New: decltype, enable_if, previous arguments patrick.a.moran at gmail dot com
                   ` (4 preceding siblings ...)
  2014-06-23 17:10 ` redi at gcc dot gnu.org
@ 2014-06-23 17:43 ` patrick.a.moran at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: patrick.a.moran at gmail dot com @ 2014-06-23 17:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61370

Patrick Moran <patrick.a.moran at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #6 from Patrick Moran <patrick.a.moran at gmail dot com> ---
Marking this as a duplicate - it is the same problem as c++/52830, it just
manifests differently in 4.9.0 than in head.

*** This bug has been marked as a duplicate of bug 52830 ***


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-06-23 17:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-30 15:14 [Bug c++/61370] New: decltype, enable_if, previous arguments patrick.a.moran at gmail dot com
2014-05-30 19:47 ` [Bug c++/61370] " redi at gcc dot gnu.org
2014-05-30 20:09 ` paolo.carlini at oracle dot com
2014-05-30 20:12 ` paolo.carlini at oracle dot com
2014-06-23 14:51 ` patrick.a.moran at gmail dot com
2014-06-23 17:10 ` redi at gcc dot gnu.org
2014-06-23 17:43 ` patrick.a.moran at gmail dot com

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).