Open
Description
With this PR, there are 6 failing 3C test cases:
Clang :: 3C/3d-allocation.c
Clang :: 3C/function_typedef.c
Clang :: 3C/itype_nt_arr_cast.c
Clang :: 3C/itype_undef.c
Clang :: 3C/prototype_success1.c
Clang :: 3C/prototype_success2.c
Clang :: 3C/valist.c
I debugged 3C/prototype_success2.c
, which is oddly compiled when you run the 3C\prototype_success1.c
test. The 3C failure is due to trying to get a source location for a compiler-generated variable declaration. The test case that triggers the failures shows the problem:
_Ptr<int> foo(int *, char);
In the prototype declaration, only the types of the arguments are declared. The compiler generates a variable declaration. When 3C tries to fetch the source code location, an assert happens.
Here's a partial call stack. This is on Windows using the VS Studio debugger:
> 3c.exe!HandleAbort(int Sig) Line 415 C++
[External Code]
3c.exe!clang::SourceManager::getFileIDLoaded(unsigned int SLocOffset) Line 868 C++
3c.exe!clang::SourceManager::getFileIDSlow(unsigned int SLocOffset) Line 779 C++
3c.exe!clang::SourceManager::getFileID(unsigned int SLocOffset) Line 1831 C++
3c.exe!clang::SourceManager::getFileID(clang::SourceLocation SpellingLoc) Line 1120 C++
3c.exe!clang::SourceManager::getExpansionLocSlowCase(clang::SourceLocation Loc) Line 946 C++
3c.exe!clang::SourceManager::getExpansionLoc(clang::SourceLocation Loc) Line 1172 C++
3c.exe!PersistentSourceLoc::mkPSL(clang::SourceRange SR, clang::SourceLocation SL, const clang::ASTContext & Context) Line 61 C++
3c.exe!PersistentSourceLoc::mkPSL(const clang::Decl * D, const clang::ASTContext & C) Line 26 C++
3c.exe!MappingVisitor::VisitDecl(clang::Decl * D) Line 18 C++
3c.exe!clang::RecursiveASTVisitor<MappingVisitor>::WalkUpFromDecl(clang::Decl * D) Line 440 C++
3c.exe!clang::RecursiveASTVisitor<MappingVisitor>::WalkUpFromNamedDecl(clang::NamedDecl * D) Line 107 C++