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 8134 - "This decl is not contained in a translation unit!" assertion failure using PCH
Summary: "This decl is not contained in a translation unit!" assertion failure using PCH
Status: RESOLVED FIXED
Alias: None
Product: new-bugs
Classification: Unclassified
Component: new bugs (show other bugs)
Version: trunk
Hardware: PC Linux
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-12 21:20 PDT by Eelis
Modified: 2010-09-13 06:49 PDT (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 Eelis 2010-09-12 21:20:09 PDT
If I have pre.hpp containing:

  template<class T> void f(T);
  template<class T> void f(T);
  void g() { f(0); f('x'); }

Then if I do:

  clang -cc1 pre.hpp -emit-pch -o pre.hpp.pch
  echo | clang -cc1 -include-pch pre.hpp.pch -x c++ -

The second invocation results in:

  clang: DeclBase.cpp:199: clang::TranslationUnitDecl*
    clang::Decl::getTranslationUnitDecl(): Assertion
  `DC && "This decl is not contained in a translation unit!"' failed.

I'm using Clang r113729.
Comment 1 Argyrios Kyrtzidis 2010-09-13 06:49:13 PDT
Fixed at r113744, thanks for the report!