aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/ASTContext.cpp2
-rw-r--r--test/Sema/transparent-union.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 1bbe08e38d..42efcfbee7 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -4736,7 +4736,7 @@ QualType ASTContext::mergeTransparentUnionType(QualType T, QualType SubType,
if (UD->hasAttr<TransparentUnionAttr>()) {
for (RecordDecl::field_iterator it = UD->field_begin(),
itend = UD->field_end(); it != itend; ++it) {
- QualType ET = it->getType();
+ QualType ET = getCanonicalParamType(it->getType());
QualType MT = mergeTypes(ET, SubType, OfBlockPointer, Unqualified);
if (!MT.isNull())
return MT;
diff --git a/test/Sema/transparent-union.c b/test/Sema/transparent-union.c
index d13b4045a9..a825ed8a2e 100644
--- a/test/Sema/transparent-union.c
+++ b/test/Sema/transparent-union.c
@@ -2,6 +2,7 @@
typedef union {
int *ip;
float *fp;
+ long *__restrict rlp;
} TU __attribute__((transparent_union));
void f(TU); // expected-note{{passing argument to parameter here}}
@@ -26,6 +27,9 @@ void fip(int *i) {}
void ffp(TU);
void ffp(float *f) {}
+void flp(TU);
+void flp(long *l) {}
+
void fvp(TU); // expected-note{{previous declaration is here}}
void fvp(void *p) {} // expected-error{{conflicting types}}