Fix initializing TypeOfTypeLoc
authorOlivier Goffart <ogoffart@woboq.com>
Fri, 24 Oct 2014 13:52:55 +0000 (13:52 +0000)
committerOlivier Goffart <ogoffart@woboq.com>
Fri, 24 Oct 2014 13:52:55 +0000 (13:52 +0000)
commitdf6d7b1564d292a339f07b17c7e38511e589be3d
tree98660b12129568e65f8d9daf6cdd2df84a221ab3
parent8d69aedbd5de2aaf2b2dcbdb2e01aff319c32812
Fix initializing TypeOfTypeLoc

This fixes a crash in the RecursiveASTVisitor on such code
 __typeof__(struct F*) var[invalid];

The UnderlyingTInfo of a TypeOfTypeLoc was left uninitialized when
created from ASTContext::getTrivialTypeSourceInfo
This lead to a crash in RecursiveASTVisitor when trying to access it.

llvm-svn: 220562
clang/include/clang/AST/TypeLoc.h
clang/lib/AST/TypeLoc.cpp
clang/unittests/Tooling/RecursiveASTVisitorTestTypeLocVisitor.cpp