public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58080] New: internal compiler error, decltype in function declaration (for SFINAE purposes)
@ 2013-08-04 18:46 nickolay.merkin at gmail dot com
  2013-08-04 18:56 ` [Bug c++/58080] " paolo.carlini at oracle dot com
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: nickolay.merkin at gmail dot com @ 2013-08-04 18:46 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58080

            Bug ID: 58080
           Summary: internal compiler error, decltype in function
                    declaration (for SFINAE purposes)
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nickolay.merkin at gmail dot com

Created attachment 30609
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=30609&action=edit
preprocessed source code that leads to the ICE

Here is minimal example that reproduces the ICE:

g++ version 4.7.3 (Ubuntu/Linaro 4.7.3-2ubuntu1~12.04)
commandline: g++ std=c++11 x.cpp
(also crashes with std=gnu++11)

// /usr/lib/gcc/i686-linux-gnu/4.7/cc1plus -quiet -imultilib . -imultiarch
i386-linux-gnu -D_GNU_SOURCE x.cpp -quiet -dumpbase x.cpp -mtune=generic
-march=i686 -auxbase x -std=c++11 -fstack-protector -o - -frandom-seed=0
# 1 "x.cpp"
# 1 "<command-line>"
# 1 "x.cpp"
template<class A, class B>
struct Eval
{
 void foo(A a, B b) { bar(a,b, 0); }
 auto bar(A a, B b, decltype(a+b)* _) -> decltype(a+b) { return a+b; }
};

int main()
{
 Eval<int,void*> eiv; eiv.foo(0,0);
}

I intended to write a multimethod that does a+b for integral, pointer, string,
etc. types, -- and immediately met ICE.
Of course, operator+(void*,int) is not defined, but it is not a reason to
crash.
The compiler prepends the crash report with three warnings about VOID* in
arithmetic expression.


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

end of thread, other threads:[~2013-08-06  1:09 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-04 18:46 [Bug c++/58080] New: internal compiler error, decltype in function declaration (for SFINAE purposes) nickolay.merkin at gmail dot com
2013-08-04 18:56 ` [Bug c++/58080] " paolo.carlini at oracle dot com
2013-08-04 18:58 ` paolo.carlini at oracle dot com
2013-08-04 18:58 ` nickolay.merkin at gmail dot com
2013-08-04 19:07 ` paolo.carlini at oracle dot com
2013-08-04 19:26 ` nickolay.merkin at gmail dot com
2013-08-04 19:31 ` paolo.carlini at oracle dot com
2013-08-04 20:56 ` evgeny.panasyuk at gmail dot com
2013-08-04 21:00 ` paolo.carlini at oracle dot com
2013-08-04 21:05 ` paolo.carlini at oracle dot com
2013-08-05 22:05 ` paolo.carlini at oracle dot com
2013-08-05 22:12 ` nickolay.merkin at gmail dot com
2013-08-05 22:19 ` i.nixman at gmail dot com
2013-08-05 22:19 ` paolo.carlini at oracle dot com
2013-08-05 22:58 ` paolo.carlini at oracle dot com
2013-08-06  1:09 ` i.nixman 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).