This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Fix decltype of static data members
ClosedPublic

Authored by miyuki on Feb 6 2018, 7:41 AM.

Details

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.

Diff Detail

Repository
rC Clang

Event Timeline

miyuki created this revision.Feb 6 2018, 7:41 AM
miyuki edited the summary of this revision. (Show Details)
rogfer01 accepted this revision.Feb 9 2018, 10:07 AM

This LGTM. Thanks for fixing this.

Wait a couple of days before committing in case there are other comments.

This revision is now accepted and ready to land.Feb 9 2018, 10:07 AM
This revision was automatically updated to reflect the committed changes.