aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2009-01-18 00:45:31 +0000
committerNate Begeman <natebegeman@mac.com>2009-01-18 00:45:31 +0000
commit334a802eeb5acb959f99b8227ee995725b2624aa (patch)
tree45a6a8e89aa6707dd662471a4f745b9e333a2247
parent322f04dd4aba876e8eda918eac6f7ce331ed8894 (diff)
Remove outdated diagnostic. Tests are coming.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62437 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/DiagnosticKinds.def2
-rw-r--r--lib/Sema/SemaExpr.cpp12
2 files changed, 1 insertions, 13 deletions
diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def
index 018aa543e3..5db09e7f26 100644
--- a/include/clang/Basic/DiagnosticKinds.def
+++ b/include/clang/Basic/DiagnosticKinds.def
@@ -861,8 +861,6 @@ DIAG(err_ext_vector_component_requires_even, ERROR,
"vector component access invalid for odd-sized type %0")
DIAG(err_ext_vector_component_name_illegal, ERROR,
"illegal vector component name '%0'")
-DIAG(err_ext_vector_component_access, ERROR,
- "vector component access limited to variables")
DIAG(err_attribute_address_space_not_int, ERROR,
"address space attribute requires an integer constant")
DIAG(err_attribute_address_multiple_qualifiers, ERROR,
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 652397939c..7a6c36416b 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1296,12 +1296,7 @@ ActOnArraySubscriptExpr(Scope *S, ExprTy *Base, SourceLocation LLoc,
} else if (const VectorType *VTy = LHSTy->getAsVectorType()) {
BaseExpr = LHSExp; // vectors: V[123]
IndexExpr = RHSExp;
-
- // Component access limited to variables (reject vec4.rg[1]).
- if (!isa<DeclRefExpr>(BaseExpr) && !isa<ArraySubscriptExpr>(BaseExpr) &&
- !isa<ExtVectorElementExpr>(BaseExpr))
- return Diag(LLoc, diag::err_ext_vector_component_access)
- << SourceRange(LLoc, RLoc);
+
// FIXME: need to deal with const...
ResultType = VTy->getElementType();
} else {
@@ -1633,11 +1628,6 @@ ActOnMemberReferenceExpr(Scope *S, ExprTy *Base, SourceLocation OpLoc,
}
// Handle 'field access' to vectors, such as 'V.xx'.
if (BaseType->isExtVectorType() && OpKind == tok::period) {
- // Component access limited to variables (reject vec4.rg.g).
- if (!isa<DeclRefExpr>(BaseExpr) && !isa<ArraySubscriptExpr>(BaseExpr) &&
- !isa<ExtVectorElementExpr>(BaseExpr))
- return Diag(MemberLoc, diag::err_ext_vector_component_access)
- << BaseExpr->getSourceRange();
QualType ret = CheckExtVectorComponent(BaseType, OpLoc, Member, MemberLoc);
if (ret.isNull())
return true;