Skip to content

Commit 24ba2a0

Browse files
committed
Tests for proper pre-C++11 handling of "auto"
1 parent 830c1d8 commit 24ba2a0

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

regression/cpp/auto2/main.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
int main()
2+
{
3+
#ifndef _MSC_VER
4+
// Visual Studio uses C++14 by default, thus the below would not be valid
5+
auto int x = 42;
6+
#endif
7+
}

regression/cpp/auto2/test.desc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
main.cpp
3+
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
^warning: ignoring
8+
^CONVERSION ERROR$

regression/cpp/auto3/main.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
int main()
2+
{
3+
#ifndef _MSC_VER
4+
// should yield a parse error unless in C++11 (or later) mode
5+
auto x = 42;
6+
#else
7+
intentionally invalid
8+
#endif
9+
}

regression/cpp/auto3/test.desc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CORE
2+
main.cpp
3+
4+
^EXIT=(64|1)$
5+
^SIGNAL=0$
6+
parse error
7+
--
8+
^warning: ignoring
9+
^CONVERSION ERROR$

0 commit comments

Comments
 (0)