Bad ICE

So this is happening:

$ cat t.cpp
#include <iostream>

class Foo {
  std::map<int, int> bar;
};

$ clang++ t.cpp
0 clang 0x0000000105633312 _ZL15PrintStackTracePv + 34
1 clang 0x00000001056337e9 _ZL13SignalHandleri + 633
2 libsystem_c.dylib 0x00007fff8ed48cfa _sigtramp + 26
3 libsystem_c.dylib 0xffffffffffffffff _sigtramp + 18446603338119869215
4 clang 0x0000000104ee9b08 clang::Parser::ParseImplicitInt(clang::DeclSpec&, clang::CXXScopeSpec*, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier) + 93\
6
5 clang 0x0000000104ee8f04 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::D\
eclSpecContext) + 4196
6 clang 0x0000000104cc029d clang::Parser::ParseCXXClassMemberDeclaration(clang::AccessSpecifier, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ParsingDeclRAII\
Object*) + 2109
7 clang 0x0000000104cbea1b clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int, clang::Decl*) + 1563
8 clang 0x0000000104eecd09 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, c\
lang::AccessSpecifier, bool) + 4473
9 clang 0x0000000104ee879b clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier, clang::Parser::D\
eclSpecContext) + 2299
10 clang 0x00000001048d2527 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&, clang::AccessSpecifier) + 71
11 clang 0x00000001048d2465 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::AccessSpecifier) + 373
12 clang 0x00000001048b269f clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::Parser::ParsingDeclSpec*) + 2479
13 clang 0x00000001048b1c7d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 237
14 clang 0x0000000104893ffd clang::ParseAST(clang::Sema&, bool) + 301
15 clang 0x0000000104892aaf clang::CodeGenAction::ExecuteAction() + 671
16 clang 0x000000010487e89b clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 875
17 clang 0x000000010487c918 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 2696
18 clang 0x0000000104871115 cc1_main(char const**, char const**, char const*, void*) + 5333
19 clang 0x000000010485427b main + 667
20 clang 0x0000000104853fd4 start + 52
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-apple-macosx10.7.3 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name t.cpp -pic-level 1 -mdisab\
le-fp-elim -relaxed-aliasing -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 127.2 -resource-dir /usr/bin/../lib/clang/3.0 -fdeprecated-macro -ferror-limit 19 \
-fmessage-length 183 -stack-protector 1 -fblocks -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o /var/folders/v7/xx0tg22s1r97p9hg01fr1ybh0000gn/T/cc-14EALs.o -x c++ t.cpp
1. t.cpp:4:8: current parser token 'map'
2. t.cpp:3:1: parsing struct/union/class body 'Foo'
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal 2 (use -v to see invocation)

-bw

Can you provide preprocessed source? This doesn’t repro for me using either libstdc++ or libc++.

I don't see this on ToT anymore...

-bw

chapuni just fixed a memory corruption bug, that could easily had caused this on a restricted set of platforms…