mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 06:15:44 +08:00
Fix unused variable treatment (#139)
Right now our CMake infra specifies -Wno-unused only for GCC builds, but Makefile specifies it for all builds. The intent has been to use it just for GCC, so we now do that by detecting the compiler version - this should equalize the behavior across different types of builds. Separately, latest version of clang appears to expose an unused variable that clang-10 was okay with, so fix that. (change from upstream)
This commit is contained in:
parent
aea1f6a718
commit
a80fc93646
@ -2379,15 +2379,12 @@ AstArray<AstTypeOrPack> Parser::parseTypeParams()
|
||||
Lexeme begin = lexer.current();
|
||||
nextLexeme();
|
||||
|
||||
bool seenPack = false;
|
||||
while (true)
|
||||
{
|
||||
if (FFlag::LuauParseTypePackTypeParameters)
|
||||
{
|
||||
if (shouldParseTypePackAnnotation(lexer))
|
||||
{
|
||||
seenPack = true;
|
||||
|
||||
auto typePack = parseTypePackAnnotation();
|
||||
|
||||
if (FFlag::LuauTypeAliasPacks) // Type packs are recorded only is we can handle them
|
||||
@ -2399,8 +2396,6 @@ AstArray<AstTypeOrPack> Parser::parseTypeParams()
|
||||
|
||||
if (typePack)
|
||||
{
|
||||
seenPack = true;
|
||||
|
||||
if (FFlag::LuauTypeAliasPacks) // Type packs are recorded only is we can handle them
|
||||
parameters.push_back({{}, typePack});
|
||||
}
|
||||
|
5
Makefile
5
Makefile
@ -49,7 +49,10 @@ OBJECTS=$(AST_OBJECTS) $(COMPILER_OBJECTS) $(ANALYSIS_OBJECTS) $(VM_OBJECTS) $(T
|
||||
CXXFLAGS=-g -Wall -Werror
|
||||
LDFLAGS=
|
||||
|
||||
CXXFLAGS+=-Wno-unused # temporary, for older gcc versions
|
||||
# temporary, for older gcc versions as they treat var in `if (type var = val)` as unused
|
||||
ifeq ($(findstring g++,$(shell $(CXX) --version)),g++)
|
||||
CXXFLAGS+=-Wno-unused
|
||||
endif
|
||||
|
||||
# configuration-specific flags
|
||||
ifeq ($(config),release)
|
||||
|
Loading…
Reference in New Issue
Block a user