Skip to content
Snippets Groups Projects
Commit 38f2bfbb authored by Ben Langmuir's avatar Ben Langmuir
Browse files

Revert "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag"

This is causing assertion failures; reverting until I can fix.

This reverts commit r255267

llvm-svn: 255324
parent 1e5dfeda
No related branches found
No related tags found
No related merge requests found
...@@ -12121,12 +12121,10 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, ...@@ -12121,12 +12121,10 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
   
// In C++, we need to do a redeclaration lookup to properly // In C++, we need to do a redeclaration lookup to properly
// diagnose some problems. // diagnose some problems.
// FIXME: this lookup is also used (with and without C++) to find a hidden if (getLangOpts().CPlusPlus) {
// declaration so that we don't get ambiguity errors when using a type Previous.setRedeclarationKind(ForRedeclaration);
// declared by an elaborated-type-specifier. In C that is not correct and LookupQualifiedName(Previous, SearchDC);
// we should instead merge compatible types found by lookup. }
Previous.setRedeclarationKind(ForRedeclaration);
LookupQualifiedName(Previous, SearchDC);
} }
   
// If we have a known previous declaration to use, then use it. // If we have a known previous declaration to use, then use it.
......
struct S1;
struct S2 { int x; };
struct S3 { int x; };
...@@ -386,10 +386,3 @@ module TypedefTag { ...@@ -386,10 +386,3 @@ module TypedefTag {
header "typedef-tag-hidden.h" header "typedef-tag-hidden.h"
} }
} }
module ElaboratedTypeStructs {
module Empty {}
module Structs {
header "elaborated-type-structs.h"
}
}
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify
@import ElaboratedTypeStructs.Empty; // The structs are now hidden.
struct S1 *x;
struct S2 *y;
// FIXME: compatible definition should not be an error.
struct S2 { int x; }; // expected-error {{redefinition}}
struct S3 *z;
// Incompatible definition.
struct S3 { float y; }; // expected-error {{redefinition}}
// expected-note@elaborated-type-structs.h:* 2 {{previous definition is here}}
@import ElaboratedTypeStructs.Structs;
void useS1(struct S1 *x);
void useS2(struct S2 *x);
void useS2(struct S2 *x);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment