unsigned ImportedFromModuleID = 0,
ArrayRef<unsigned> Overrides = None)
: MacroDirective(MD_Undefine, UndefLoc, ImportedFromModuleID, Overrides) {
- assert(UndefLoc.isValid() && "Invalid UndefLoc!");
+ assert((UndefLoc.isValid() || ImportedFromModuleID) && "Invalid UndefLoc!");
}
static bool classof(const MacroDirective *MD) {
--- /dev/null
+@import macros_right;
+
+extern TOP_DEF_RIGHT_UNDEF *TDRUp;
@import macros_top;
#undef TOP_OTHER_DEF_RIGHT_UNDEF
+#undef TOP_DEF_RIGHT_UNDEF
#define TOP_OTHER_DEF_RIGHT_UNDEF void
#define TOP_REDEF_IN_SUBMODULES 0
+#define TOP_DEF_RIGHT_UNDEF void
header "macros_right_undef.h"
}
}
+module macros_bottom {
+ header "macros_bottom.h"
+ export *
+}
module macros { header "macros.h" }
module macros_other { header "macros_other.h" }
module category_top { header "category_top.h" }
# error TOP_RIGHT_UNDEF should still be defined
#endif
+@import macros_bottom;
+
+TOP_DEF_RIGHT_UNDEF *TDRUf() { return TDRUp; }
+
@import macros_right.undef;
+int TOP_DEF_RIGHT_UNDEF; // ok, no longer defined
+
// FIXME: When macros_right.undef is built, macros_top is visible because
// the state from building macros_right leaks through, so macros_right.undef
// undefines macros_top's macro.