]> granicus.if.org Git - clang/commit
Add check for kind of UnqualifiedId in Declarator::isStaticMember()
authorPetar Jovanovic <petar.jovanovic@imgtec.com>
Mon, 30 Mar 2015 00:43:56 +0000 (00:43 +0000)
committerPetar Jovanovic <petar.jovanovic@imgtec.com>
Mon, 30 Mar 2015 00:43:56 +0000 (00:43 +0000)
commit97a8cdd7d1be836e6ac3e63a6aa945952fb248d2
treec44b843ee7c26111507833d4659111408017dfe1
parent17e717d907548cdc150c2229b1dc00f1f8af775f
Add check for kind of UnqualifiedId in Declarator::isStaticMember()

Method CXXMethodDecl::isStaticOverloadedOperator expects Operator field
from the struct OperatorFunctionId, which is a member of the union in
the class UnqualifiedId. If the kind of UnqualifiedId is not checked,
there is no guarantee that the value that this method receives will be
correct, because it can be the value of another union member and not
OperatorFunctionId.

This bug manifests itself when running make check-all on mips64 BE.

This fix resolves the following regression tests:
Clang :: CXX/special/class.dtor/p9.cpp
Clang :: CodeGenCXX/2006-09-12-OpaqueStructCrash.cpp
Clang :: CodeGenCXX/ctor-dtor-alias.cpp
Clang :: CodeGenCXX/debug-info-windows-dtor.cpp
Clang :: CodeGenCXX/dllexport-members.cpp
Clang :: CodeGenCXX/dllexport.cpp

Patch by Violeta Vukobrat.

Differential Revision:  http://reviews.llvm.org/D8437

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233508 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/DeclSpec.cpp