http://llvm.org/bugs/show_bug.cgi?id=10655
Summary: TypeDecl::TypeForDecl set to 0 for regular TypedefDecl
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: Frontend
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
For any regular TypedefDecl its TypeDecl::TypeForDecl is set to 0.
For builtin typedefs however it seems to be set correctly.
example code (run inside a plugin):
-----------------------------------
for (clang::DeclContext::decl_iterator declIte =
context.getTranslationUnitDecl()->decls_begin(),
dEnd = context.getTranslationUnitDecl()->decls_end();
declIte != dEnd; ++declIte) {
if (const clang::TypedefDecl* tdD =
llvm::dyn_cast<clang::TypedefDecl>(*declIte)) {
tdD->print(llvm::errs());
llvm::errs() << "\n";
llvm::errs() << tdD->getTypeForDecl() << "\n\n";
}
}
yields this output:
-------------------
$ cat test.cpp
typedef int test;
$ clang -cc1 -load ./plugin.so -plugin test test.cpp
typedef char *__builtin_va_list
0xc7adc70
typedef int test
0x0
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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