[cfe-dev] ASTContext::getTypeSize() endless recursion with dependent on a template parameter

Azat Khuzhin a3at.mail at gmail.com
Thu Jun 12 07:46:58 PDT 2014


Hi folks,

I have one question about ASTContext::getTypeSize() in case when there
is dependency from template parameter (in my case this was
std::integral_constant type), is it expected behaviour that in this case
there is a endless recursion inside getTypeSize(), IOW you must manually
check for isDependentContext() to avoid it?

Here is the sample of backtrace:
<snip>
#26 0x0000000000a0ed0a in clang::ASTContext::getTypeInfo(clang::Type const*) const ()
#27 0x0000000000a12a73 in clang::ASTContext::getTypeInfoImpl(clang::Type const*) const ()
#28 0x0000000000a0ed0a in clang::ASTContext::getTypeInfo(clang::Type const*) const ()
#29 0x0000000000a12a73 in clang::ASTContext::getTypeInfoImpl(clang::Type const*) const ()
#30 0x0000000000a0ed0a in clang::ASTContext::getTypeInfo(clang::Type const*) const ()
#31 0x0000000000a12a73 in clang::ASTContext::getTypeInfoImpl(clang::Type const*) const ()
#32 0x0000000000a0ed0a in clang::ASTContext::getTypeInfo(clang::Type const*) const ()
<snip>

If no, I could send a patch for this, otherwise maybe it can be
documented, what you think?

Cheers,
Azat



More information about the cfe-dev mailing list