The source was reduced by Milian to: class LockableHolder { friend void swap(LockableHolder a, LockableHolder b) { a = b; } }; Execution of clang-parser yields: clang-parser -a /tmp/test.cpp AST tree successfully generated ClassDecl (4) | type: "LockableHolder" (105) | display: "LockableHolder" | loc: /tmp/test.cpp@[(1,1),(7,2)] | isDecl UnexposedDecl (1) | loc: /tmp/test.cpp@[(3,5),(6,6)] | isDecl no problems encountered during parsing Reproducible: Always This is likely an upstream issue.
Fix: https://reviews.llvm.org/D26285
Just tested, works. You rock, Olivier! Way to go. Using libclang 4.0 will fix this issue.