Skip to content

clang -cc1 -fdelayed-template-parsing -emit-pch does not save template contents in PCH #10364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zygoloid mannequin opened this issue May 23, 2011 · 3 comments
Closed
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented May 23, 2011

Bugzilla Link 9992
Resolution FIXED
Resolved on Mar 27, 2014 10:49
Version trunk
OS Linux
Blocks llvm/llvm-bugzilla-archive#13707
CC @DougGregor,@tritao,@synopsys-sig-compiler-frontends

Extended Description

$ echo 'template void f() { i can put anything here }' | clang++ -cc1 -x c++ -fdelayed-template-parsing -emit-pch -o tmp.pch
$ echo 'template void g() { f(); } int n = (g(), 0);' | ./clang++ -cc1 -x c++ -fdelayed-template-parsing -include-pch tmp.pch -emit-llvm -o - | grep _Z1fIiEvv
call void @​_Z1fIiEvv()
declare void @​_Z1fIiEvv()

Oops. It looks like the tokens for 'f' are neither parsed nor saved in the PCH file, resulting in us silently losing 'f's definition.

@DougGregor
Copy link
Contributor

This is also rdar://problem/13342361

@DougGregor
Copy link
Contributor

Resetting to default assignee

@llvmbot
Copy link
Member

llvmbot commented Aug 8, 2013

Fixed (slightly inefficiently) in r187916.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++
Projects
None yet
Development

No branches or pull requests

2 participants