]> granicus.if.org Git - clang/commit
[Sema] Fix decltype of static data members
authorMikhail Maltsev <mikhail.maltsev@arm.com>
Wed, 14 Feb 2018 11:34:25 +0000 (11:34 +0000)
committerMikhail Maltsev <mikhail.maltsev@arm.com>
Wed, 14 Feb 2018 11:34:25 +0000 (11:34 +0000)
commit4c88e719ddaa64ea71ece335250b69e4142a74ee
treee5acdce58dc0896c44c4695fa1a82e91d3a4a5d3
parentb7619d5070ec7ed287687a95550f53afa9c23ec9
[Sema] Fix decltype of static data members

Summary:
According to the C++11 standard [dcl.type.simple]p4:
  The type denoted by decltype(e) is defined as follows:
  - if e is an unparenthesized id-expression or an unparenthesized
    class member access (5.2.5), decltype(e) is the type of the entity
    named by e.

Currently Clang handles the 'member access' case incorrectly for
static data members (decltype returns T& instead of T). This patch
fixes the issue.

Reviewers: faisalv, rsmith, rogfer01

Reviewed By: rogfer01

Subscribers: rogfer01, cfe-commits

Differential Revision: https://reviews.llvm.org/D42969

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325117 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaType.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.type.simple/p4-cxx0x.cpp