LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 5793 - clang crashes when instantiating a function template whose body uses a global function of the same name
Summary: clang crashes when instantiating a function template whose body uses a global...
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: C++ (show other bugs)
Version: trunk
Hardware: All All
: P normal
Assignee: Unassigned Clang Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-15 19:24 PST by Zhanyong Wan
Modified: 2010-02-22 12:44 PST (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zhanyong Wan 2009-12-15 19:24:00 PST
$ cat t.cc
void Foo(int);

template <typename T>
class MI {
 public:
  void Foo() const {
    using ::Foo;
    Foo(0);
  }
};

void Test() {
  MI<int>().Foo();
}

$ clang -cc1 t.cc
clang: Sema.h:3137: clang::Decl* clang::Sema::LocalInstantiationScope::getInstantiationOf(const clang::Decl*): Assertion `Result && "declaration was not instantiated in this scope!"' failed.
0  clang           0x0000000001601302
1  clang           0x000000000160189e
2  libpthread.so.0 0x00007f53e789c7d0
3  libc.so.6       0x00007f53e6bc0095 gsignal + 53
4  libc.so.6       0x00007f53e6bc1af0 abort + 272
5  libc.so.6       0x00007f53e6bb92df __assert_fail + 239
6  clang           0x00000000008912ea
7  clang           0x0000000000888f17
8  clang           0x00000000008674ee
9  clang           0x000000000087c7bc
10 clang           0x000000000086b00d
11 clang           0x000000000086f4a3
12 clang           0x000000000086a05c
13 clang           0x000000000086930c
14 clang           0x0000000000869565
15 clang           0x000000000087e3c5
16 clang           0x000000000086891c
17 clang           0x0000000000880caa
18 clang           0x000000000088fa03
19 clang           0x000000000088f4b7
20 clang           0x0000000000745181
21 clang           0x0000000000963d8b
22 clang           0x00000000007431de
23 clang           0x000000000044ee1c
24 clang           0x000000000044ef0c
25 clang           0x0000000000433272
26 clang           0x0000000000437c67 main + 251
27 libc.so.6       0x00007f53e6bac1c4 __libc_start_main + 244
28 clang           0x0000000000431f29
Stack dump:
0.      Program arguments: clang -cc1 t.cc
1.      Program arguments: t.cc Segmentation fault
Comment 1 Chandler Carruth 2009-12-29 02:49:46 PST
This appears to have been fixed.