public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57041] New: ICE in lookup_field_1, at cp/search.c:376 (with dot-prefixed structure initialisation)
@ 2013-04-23  8:21 slayoo at staszic dot waw.pl
  2013-04-23  8:56 ` [Bug c++/57041] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: slayoo at staszic dot waw.pl @ 2013-04-23  8:21 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 57041
           Summary: ICE in lookup_field_1, at cp/search.c:376 (with
                    dot-prefixed structure initialisation)
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: slayoo@staszic.waw.pl


Hi,


$ cat bug.cpp 
#include <map>
#include <string>

template <class T>
void setopts(T &p)
{
  p.outvars = {{0, {.name = "psi", .unit = "1"}}};
}

int main()
{        
  struct 
  {
    struct info { std::string name, unit; };
    std::map<int, info> outvars;
  } p;
  setopts(p);
}



$ /usr/lib/gcc-snapshot/bin/g++ -std=c++11 bug.cpp 
bug.cpp: In instantiation of 'void setopts(T&) [with T = main()::<anonymous
struct>]':
bug.cpp:17:12:   required from here
bug.cpp:7:13: error: 'name' was not declared in this scope
   p.outvars = {{0, {.name = "psi", .unit = "1"}}};
             ^
bug.cpp:7:13: error: 'unit' was not declared in this scope
bug.cpp:7:13: internal compiler error: in lookup_field_1, at cp/search.c:376
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-snapshot/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccLInnuE.out file, please attach this to
your bugreport.



$ /usr/lib/gcc-snapshot/bin/g++ --version
g++ (Debian 20130209-1) 4.8.0 20130209 


Clang compiles it with no warnings or errors.

HTH,
Sylwester


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

end of thread, other threads:[~2013-05-14 15:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-23  8:21 [Bug c++/57041] New: ICE in lookup_field_1, at cp/search.c:376 (with dot-prefixed structure initialisation) slayoo at staszic dot waw.pl
2013-04-23  8:56 ` [Bug c++/57041] " mpolacek at gcc dot gnu.org
2013-04-23  9:41 ` [Bug c++/57041] [4.7/4.8 Regression] " jakub at gcc dot gnu.org
2013-04-23 10:06 ` [Bug c++/57041] [4.7/4.8/4.9 " mpolacek at gcc dot gnu.org
2013-04-24  9:28 ` paolo.carlini at oracle dot com
2013-05-13 19:35 ` jason at gcc dot gnu.org
2013-05-14 14:55 ` jason at gcc dot gnu.org
2013-05-14 15:53 ` paolo.carlini at oracle 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).