Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Viewed less than a minute ago

BSefr8GTxkJapVgK

C++ gcc 12.1.0

Created at 1 minute ago

Created by anonymous

Author

anonymous

1 minute ago

Language

C++

Compiler

gcc 12.1.0

Options
Warnings
Don't Use Boost
C++11
-pedantic-errors
セオライド・テクノロジー㈱株式会社フィックスターズ

Author

anonymous

1 minute ago

›
⌄
⌄
⌄
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <vector>

struct hoge {
};

struct SMyStruct {
hoge StructElement1;
};

int main() {
std::vector<SMyStruct> myVec;
myVec.push_back(SMyStruct());
for( auto elem : myVec )
auto local1 = elem.StructElement1;
}

$ g++ prog.cc -Wall -Wextra -std=c++11 -pedantic-errors
prog.cc: In function 'int main()':
prog.cc:14:14: warning: variable 'local1' set but not used [-Wunused-but-set-variable]
   14 |         auto local1 = elem.StructElement1;
      |              ^~~~~~
Exit Code:
0
セオライド・テクノロジー㈱株式会社フィックスターズ