diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-03-22 21:28:55 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-03-22 21:28:55 +0000 |
commit | dfe292dbebe84bc3a19dba83e9eef52d56492b0a (patch) | |
tree | f2734bd61805045014761d059ea441bf0f8727d2 /lib/Sema/SemaType.cpp | |
parent | 82227ff4eb665bbf41720ebdc0dc9215a86ba838 (diff) |
Fix build from r67476 and address the easy part of Doug's comments on rvalue refs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 24b32e8147..3f4e78cf28 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -323,10 +323,13 @@ QualType Sema::BuildReferenceType(QualType T, bool LValueRef, unsigned Quals, SourceLocation Loc, DeclarationName Entity) { if (LValueRef) { if (const RValueReferenceType *R = T->getAsRValueReferenceType()) { - // FIXME: Find the C++0x reference for reference collapsing. - // In reference collapsing, lvalue refs win over rvalue refs. + // C++0x [dcl.typedef]p9: If a typedef TD names a type that is a + // reference to a type T, and attempt to create the type "lvalue + // reference to cv TD" creates the type "lvalue reference to T". + // We use the qualifiers (restrict or none) of the original reference, + // not the new ones. This is consistent with GCC. return Context.getLValueReferenceType(R->getPointeeType()). - getQualifiedType(Quals); + getQualifiedType(T.getCVRQualifiers()); } } if (T->isReferenceType()) { |