Skip to content

Conversation

@GrumpyPigSkin
Copy link
Contributor

Added diagnosis and fixit comment for possible accidental comparison operator in an enum.

Closes: #168146

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Nov 17, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 17, 2025

@llvm/pr-subscribers-clang

Author: None (GrumpyPigSkin)

Changes

Added diagnosis and fixit comment for possible accidental comparison operator in an enum.

Closes: #168146


Full diff: https://github.com/llvm/llvm-project/pull/168445.diff

3 Files Affected:

  • (modified) clang/include/clang/Basic/DiagnosticSemaKinds.td (+10)
  • (modified) clang/lib/Sema/SemaDecl.cpp (+24)
  • (added) clang/test/Sema/warn-enum-compare-typo.c (+38)
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 3e864475f22a1..b4da42584c78f 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -13707,4 +13707,14 @@ def err_amdgcn_load_lds_size_invalid_value : Error<"invalid size value">;
 def note_amdgcn_load_lds_size_valid_value : Note<"size must be %select{1, 2, or 4|1, 2, 4, 12 or 16}0">;
 
 def err_amdgcn_coop_atomic_invalid_as : Error<"cooperative atomic requires a global or generic pointer">;
+
+def warn_comparison_in_enum_initializer
+    : Warning<"comparison operator '%0' in enumerator constant is likely a "
+              "typo for "
+              "the shift operator '%1'">,
+      InGroup<DiagGroup<"enum-compare-typo">>;
+
+def note_enum_compare_typo_suggest
+    : Note<"use '%0' to perform a bitwise shift">;
+
 } // end of sema component.
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 086dd8ba1c670..ae3e6f2f49917 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -20129,6 +20129,30 @@ EnumConstantDecl *Sema::CheckEnumConstant(EnumDecl *Enum,
   if (Val)
     Val = DefaultLvalueConversion(Val).get();
 
+  if (Val) {
+    if (const BinaryOperator *BinOp =
+            dyn_cast<BinaryOperator>(Val->IgnoreParenImpCasts())) {
+      if (BinOp->getOpcode() == BO_LT || BinOp->getOpcode() == BO_GT) {
+        const Expr *LHS = BinOp->getLHS()->IgnoreParenImpCasts();
+        if (const auto *IntLiteral = dyn_cast<IntegerLiteral>(LHS)) {
+          if (IntLiteral->getValue() == 1) {
+            auto suggestedOp = (BinOp->getOpcode() == BO_LT)
+                                   ? BinaryOperator::getOpcodeStr(BO_Shl)
+                                   : BinaryOperator::getOpcodeStr(BO_Shr);
+            SourceLocation OperatorLoc = BinOp->getOperatorLoc();
+
+            Diag(OperatorLoc, diag::warn_comparison_in_enum_initializer)
+                << BinOp->getOpcodeStr() << suggestedOp;
+
+            Diag(OperatorLoc, diag::note_enum_compare_typo_suggest)
+                << suggestedOp
+                << FixItHint::CreateReplacement(OperatorLoc, suggestedOp);
+          }
+        }
+      }
+    }
+  }
+
   if (Val) {
     if (Enum->isDependentType() || Val->isTypeDependent() ||
         Val->containsErrors())
diff --git a/clang/test/Sema/warn-enum-compare-typo.c b/clang/test/Sema/warn-enum-compare-typo.c
new file mode 100644
index 0000000000000..ee6ef0676b4b8
--- /dev/null
+++ b/clang/test/Sema/warn-enum-compare-typo.c
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -fsyntax-only -Wenum-compare-typo -verify %s 
+// RUN: %clang_cc1 -fsyntax-only -Wenum-compare-typo -fdiagnostics-parseable-fixits %s 2>&1 | FileCheck %s
+
+enum E {
+  kOptionGood1 = 1ull << 0,
+  kOptionGood2 = 1ull >> 0,
+  // expected-warning@+3 {{comparison operator '<' in enumerator constant is likely a typo for the shift operator '<<'}} 
+  // expected-note@+2 {{use '<<' to perform a bitwise shift}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE+1]]:22-[[@LINE+1]]:23}:"<<"
+  kOptionBad1 = 1ull < 1,
+  // expected-warning@+3 {{comparison operator '>' in enumerator constant is likely a typo for the shift operator '>>'}}
+  // expected-note@+2 {{use '>>' to perform a bitwise shift}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE+1]]:19-[[@LINE+1]]:20}:">>"
+  kOptionBad2 = 1 > 3,
+  // expected-warning@+3 {{comparison operator '>' in enumerator constant is likely a typo for the shift operator '>>'}} 
+  // expected-note@+2 {{use '>>' to perform a bitwise shift}}
+  // CHECK: fix-it:"{{.*}}":{[[@LINE+1]]:20-[[@LINE+1]]:21}:">>"
+  kOptionBad3 = (1 > 2)
+};
+
+// Ensure the warning does not fire on valid code
+enum F {
+  kSomeValue = 10,
+  kComparison = kSomeValue > 5, // No warning
+  kMaxEnum = 255,
+  kIsValid = kMaxEnum > 0, // No warning
+  kSum = 10 + 20,          // No warning
+  kShift = 2 << 5          // No warning
+};
+
+// Ensure the diagnostic group works
+
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wenum-compare-typo"
+enum G {
+  kIgnored = 1 < 10 // No warning
+};
+#pragma clang diagnostic pop

@GrumpyPigSkin
Copy link
Contributor Author

@AaronBallman Please could you advise on who is best to review :)

@github-actions
Copy link

github-actions bot commented Nov 17, 2025

🐧 Linux x64 Test Results

  • 111348 tests passed
  • 4420 tests skipped

Copy link
Contributor

@ojhunt ojhunt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually a good idea, but I think it could be re-worked such that it is more accurate - avoiding both false-positives and negatives.

Also needs test coverage for other common idioms as we don't want a warning that fires all the time on valid/idiomatic code.

def err_amdgcn_coop_atomic_invalid_as : Error<"cooperative atomic requires a global or generic pointer">;

def warn_comparison_in_enum_initializer
: Warning<"comparison operator '%0' in enumerator constant is likely a "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My inclination is for "may" rather than "likely", there also needs to be a way to suppress this warning locally - having to put pragmas around blocks is error prone, and using a global -Wno- flag loses the warning for all code.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say "is potentially a typo for a shift operator '%1'"

As for the suppression, I think an explicit cast to bool would be a reasonable marker of "I meant to do that".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have gone with "is potentially a typo for a shift operator '%1'".
I used any explicit cast to suppress the warning, is that fine?

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! You should also add a release note to clang/docs/ReleaseNotes.rst so users know about the improved diagnostic.

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@AaronBallman AaronBallman merged commit aeba7a8 into llvm:main Nov 20, 2025
11 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2025

LLVM Buildbot has detected a new failure on builder flang-x86_64-windows running on minipc-ryzen-win while building clang at step 6 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/166/builds/4081

Here is the relevant piece of the build log for the reference
Step 6 (build-unified-tree) failure: build (failure)
...
744.199 [823/6/319] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaDeclObjC.cpp.obj
746.775 [822/6/320] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaExceptionSpec.cpp.obj
748.196 [821/6/321] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaDeclAttr.cpp.obj
760.155 [820/6/322] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaDecl.cpp.obj
762.087 [819/6/323] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaDeclCXX.cpp.obj
773.504 [818/6/324] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaExprMember.cpp.obj
779.155 [817/6/325] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaFixItUtils.cpp.obj
779.587 [816/6/326] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaExprObjC.cpp.obj
780.059 [815/6/327] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaFunctionEffects.cpp.obj
782.961 [814/6/328] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaExprCXX.cpp.obj
FAILED: [code=3221225477] tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaExprCXX.cpp.obj 
ccache C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\cl.exe  /nologo /TP -DCLANG_BUILD_STATIC -DGTEST_HAS_RTTI=0 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_GLIBCXX_ASSERTIONS -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IC:\buildbot\flang-x86_64-windows\build\tools\clang\lib\Sema -IC:\buildbot\flang-x86_64-windows\llvm-project\clang\lib\Sema -IC:\buildbot\flang-x86_64-windows\llvm-project\clang\include -IC:\buildbot\flang-x86_64-windows\build\tools\clang\include -IC:\buildbot\flang-x86_64-windows\build\include -IC:\buildbot\flang-x86_64-windows\llvm-project\llvm\include /DWIN32 /D_WINDOWS   /Zc:inline /Zc:preprocessor /Zc:__cplusplus /Oi /bigobj /permissive- /W4 -wd4141 -wd4146 -wd4244 -wd4267 -wd4291 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd5105 -wd4324 -wd4251 -wd4275 -w14062 -we4238 /Gw /O2 /Ob2  -std:c++17 -MD  /EHs-c- /GR- -UNDEBUG /showIncludes /Fotools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaExprCXX.cpp.obj /Fdtools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\ /FS -c C:\buildbot\flang-x86_64-windows\llvm-project\clang\lib\Sema\SemaExprCXX.cpp
..\llvm-project\clang\lib\Sema\SemaExprCXX.cpp(8093): fatal error C1001: Internal compiler error.
(compiler file 'msc1.cpp', line 1589)
 To work around this problem, try simplifying or changing the program near the locations listed above.
If possible please provide a repro here: https://developercommunity.visualstudio.com 
Please choose the Technical Support command on the Visual C++ 
 Help menu, or open the Technical Support help file for more information
INTERNAL COMPILER ERROR in 'C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\cl.exe'
    Please choose the Technical Support command on the Visual C++
    Help menu, or open the Technical Support help file for more information
794.298 [814/5/329] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaHexagon.cpp.obj
804.897 [814/4/330] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaHLSL.cpp.obj
806.302 [814/3/331] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaLambda.cpp.obj
810.543 [814/2/332] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaInit.cpp.obj
820.395 [814/1/333] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaExpr.cpp.obj
ninja: build stopped: subcommand failed.
Cache directory:      C:\Users\buildbot-worker\AppData\Local\ccache
Config file:          C:\Users\buildbot-worker\AppData\Local\ccache\ccache.conf
System config file:   C:\ProgramData\ccache\ccache.conf
Stats updated:        11/20/25 06:22:46
Cacheable calls:        265 / 266 (99.62%)
  Hits:                   1 / 265 ( 0.38%)
    Direct:               1 /   1 (100.0%)
    Preprocessed:         0 /   1 ( 0.00%)
  Misses:               264 / 265 (99.62%)
Uncacheable calls:        1 / 266 ( 0.38%)
  Compilation failed:     1 /   1 (100.0%)
Successful lookups:
  Direct:                 1 / 266 ( 0.38%)
  Preprocessed:           0 / 265 ( 0.00%)
Local storage:
  Cache size (GB):      5.0 / 5.0 (100.1%)
  Files:              23182
  Cleanups:              23
  Hits:                   1 / 265 ( 0.38%)
  Misses:               264 / 265 (99.62%)
  Reads:                532
  Writes:               528

@llvm-ci
Copy link
Collaborator

llvm-ci commented Nov 20, 2025

LLVM Buildbot has detected a new failure on builder clang-m68k-linux-cross running on suse-gary-m68k-cross while building clang at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/19207

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
...
[197/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/StaticAnalyzer/UnsignedStatDemo.cpp.o
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/StaticAnalyzer/UnsignedStatDemo.cpp: In member function ‘void {anonymous}::UnsignedStatTesterChecker::checkBeginFunction(clang::ento::CheckerContext&) const’:
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/StaticAnalyzer/UnsignedStatDemo.cpp:47:7: warning: suggest braces around empty body in an ‘else’ statement [-Wempty-body]
   47 |       ; // For any other function (e.g., "func_none") don't set the statistic
      |       ^
[198/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp.o
[199/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Analysis/FlowSensitive/TransferTest.cpp.o
[200/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/CommentParser.cpp.o
[201/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/CommentLexer.cpp.o
[202/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersTraversalTest.cpp.o
FAILED: tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersTraversalTest.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/Tooling -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googletest/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-dangling-reference -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG -std=c++17  -Wno-variadic-macros -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersTraversalTest.cpp.o -MF tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersTraversalTest.cpp.o.d -o tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersTraversalTest.cpp.o -c /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[203/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/EvaluateAsRValueTest.cpp.o
[204/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ByteCode/Descriptor.cpp.o
[205/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterFixtures.cpp.o
[206/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterObjCTest.cpp.o
[207/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ExternalASTSourceTest.cpp.o
[208/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ConceptPrinterTest.cpp.o
[209/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ByteCode/toAPValue.cpp.o
[210/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/NamedDeclPrinterTest.cpp.o
[211/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/DeclBaseTest.cpp.o
[212/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTExprTest.cpp.o
[213/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTTypeTraitsTest.cpp.o
[214/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ProfilingTest.cpp.o
[215/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/Dynamic/RegistryTest.cpp.o
[216/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/DataCollectionTest.cpp.o
[217/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/AttrTest.cpp.o
[218/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/StaticAnalyzer/RangeSetTest.cpp.o
[219/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/Dynamic/ParserTest.cpp.o
[220/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/DeclTest.cpp.o
[221/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/Dynamic/VariantValueTest.cpp.o
[222/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/RandstructTest.cpp.o
[223/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTDumperTest.cpp.o
[224/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/DeclPrinterTest.cpp.o
[225/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTContextParentMapTest.cpp.o
[226/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/RawCommentForDeclTest.cpp.o
[227/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/QualTypeNamesTest.cpp.o
[228/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTTraverserTest.cpp.o
[229/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterVisibilityTest.cpp.o
[230/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterODRStrategiesTest.cpp.o
[231/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterGenericRedeclTest.cpp.o
[232/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/RecursiveASTVisitorTest.cpp.o
[233/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersNodeTest.cpp.o
[234/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/ASTMatchers/ASTMatchersNarrowingTest.cpp.o
[235/426] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/AST/ASTImporterTest.cpp.o
ninja: build stopped: subcommand failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clang should warn when < or > is used instead of shift operators in enum initializers

5 participants