https://llvm.org/bugs/show_bug.cgi?id=23388
Bug ID: 23388
Summary: Template compilation failure with
-fdelayed-template-parsing when compiling an AST
loaded from a PCH/AST file
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
The following test demonstrates a compilation failure that occurs only when the
code is first emitted to a .ast file, and then compiled. Direct compilation
succeeds. Tested with Clang 3.7.0 trunk (r234313), but this reproduces back to
Clang 3.4.
$ cat t.cpp
int f(int p) {
return p;
}
template<int N>
struct S {
static int smf() {
return f(static_cast<int>(N));
}
};
auto a = S<0>::smf();
$ clang -c -std=c++11 -fdelayed-template-parsing t.cpp; echo $?
0
$ clang -emit-ast -std=c++11 -fdelayed-template-parsing t.cpp; echo $?
0
$ clang -c t.ast; echo $?
/nfs/thonermann/tmp/t.cpp:7:18: error: use of undeclared identifier
'static_cast'
return f(static_cast<int>(N));
^
/nfs/thonermann/tmp/t.cpp:7:33: error: expected '(' for function-style cast or
type construction
return f(static_cast<int>(N));
~~~^
2 errors generated.
1
It seems some state is not being preserved in .ast files.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs