diff options
author | Justin Bogner <mail@justinbogner.com> | 2015-07-10 23:05:47 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2015-07-10 23:05:47 +0000 |
commit | c6ecb7c6938bae8dbd5f5d3adbc665ccc4ff0034 (patch) | |
tree | 31e45a88053e5a3fa65846ea137ed3e3b164f6d7 /clang/lib/Sema/TreeTransform.h | |
parent | 11e086d275e2c246bd682a244361aa50a5f798f1 (diff) | |
download | bcm5719-llvm-c6ecb7c6938bae8dbd5f5d3adbc665ccc4ff0034.tar.gz bcm5719-llvm-c6ecb7c6938bae8dbd5f5d3adbc665ccc4ff0034.zip |
Sema: Allow null names to be passed in to isAcceptableTagRedeclaration
It's possible for TagRedeclarations to involve decls without a name,
ie, anonymous enums. We hit some undefined behaviour if we bind these
null names to the reference here.
We never dereference the name, so it's harmless if it's null - make it
a pointer to allow that.
Fixes the Modules/submodules-merge-defs.cpp test under ubsan.
llvm-svn: 241963
Diffstat (limited to 'clang/lib/Sema/TreeTransform.h')
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 8b150c3a658..6e193a3529c 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -1010,7 +1010,7 @@ public: } if (!SemaRef.isAcceptableTagRedeclaration(Tag, Kind, /*isDefinition*/false, - IdLoc, *Id)) { + IdLoc, Id)) { SemaRef.Diag(KeywordLoc, diag::err_use_with_wrong_tag) << Id; SemaRef.Diag(Tag->getLocation(), diag::note_previous_use); return QualType(); |