Skip to main content
4 votes
2 answers
323 views

The following snippet of code compiles fine using gcc and clang with -std=c++23 -Wall and -Werror, but fails to compile under msvc with /std:c++latest /W4 /WX (Demo). #include <utility> bool ...
Xenophilius Mildrententus's user avatar
1 vote
2 answers
531 views

I know when you type std::unreachable() in your code you are guaranteeing that the code will never reach that point, and if it does it's UB (anything goes). In debug builds I've noticed there's an ...
Zebrafish's user avatar
  • 16.9k
2 votes
1 answer
232 views

Normally, I can place function calls after std::unreachable, and it has no effect. This works on MSVC, Clang, and GCC, except with GCC there is an extra detail that makes it fail compilation: #include ...
Zebrafish's user avatar
  • 16.9k
-3 votes
1 answer
89 views

Is this throw statement even reachable? It's not showing as unreachable by compiler. public static async Task<List<string>> GetSomething(int id) { using (DbContext context = new ...
Chris Hayes's user avatar
  • 4,035
0 votes
0 answers
65 views

I'm experiencing an issue where "unreachable code" in a Vue/TypeScript file is automatically deleted on save. (A pretty shocking behaviour, often I'm temporarily adding a "return false&...
Steve Bennett's user avatar
0 votes
1 answer
41 views

public PsaDTO save(PsaDTO psaDTO) { Query query = new Query(Criteria.where("numPratica").is(psaDTO.getNumPratica())); myLogger.info(myLogger.msgBuilder(MyLogger.SELECT_ID, ...
Alessandro Armari's user avatar
0 votes
1 answer
467 views

I am currently working on the following function: int cuda_device_count = 0; bool cuda_enabled = true; char devname[256]; // logger_spd is an spdlog::logger with file sink ... void InitCuda() { /...
rbaleksandar's user avatar
  • 9,909
1 vote
2 answers
2k views

I wrote this code: enum Color { kRed, kGreen, kBlue, kUnexistingColor }; const char* foo(Color color) { switch (color) { case kRed: return "red"; ...
graveman's user avatar
  • 131
1 vote
2 answers
485 views

I have a question about using a generic visitor with exclusion of non-equal types. Suppose I have the following: using StorageT = std::variant<std::vector<int>, std::vector<double>>; ...
JakeTuero's user avatar
  • 105
1 vote
1 answer
413 views

I have enum consisting of a few variants: enum Foo { A, B, C, } and i have a function, that has loop with if and match inside, all branches of which is diverging: fn my_function() -> i32 { ...
nmsamau8uwbas7's user avatar
0 votes
1 answer
217 views

I built a post dominator tree for a function in my LLVM pass. However, the function has several blocks containing only unreachable instructions, which causes that the return block cannot post-dominate ...
Lesterth's user avatar
0 votes
1 answer
54 views

This is my first post so I am sorry if I make any mistakes writing this. So I'm making a calculator program as my first personal program after learning enough on how to code with python. But I ran ...
Mearri's user avatar
  • 3
1 vote
1 answer
225 views

I have the following helper function. I am trying to create a word frequency List. (a,b,a) => [(a,2),(b,1)]: def add_to_lop(c:Char, lop: List[(Char, Int)]):List[(Char, Int)] = { lop match { ...
figs_and_nuts's user avatar
0 votes
1 answer
1k views

The following part of my code is highlighted as code unreachable in pycharm IDE. for row in range(frame_height): for col in range(frame_width): if i < ...
Heeya's user avatar
  • 1
3 votes
3 answers
403 views

Is there a warning option switch that will identify spec-level procedures, functions, or variables that are not called or referenced anywhere? I've tried the switches below without luck. This is what ...
Douglas E's user avatar

15 30 50 per page
1
2 3 4 5
13