Files
qt-creator/tests/unit/unittest/data/diagnostic_diagnostic.cpp
Nikolai Kosjar b032038781 Clang: Tests: Use test data working with clang 3.6 *and* clang 3.8
The test data produces different results when it is run with libclang
3.6 and libclang 3.8. (lib)clang 3.8 will generate an error instead of a
warning and suppress further diagnostics. See below.

Use simpler test data that is agnostic to the different clang versions.

$ cat input.cpp
    class X {
	X(X&&) noexcept;
    };

    X::X(X&&) = default;

    int function()
    {
    }

$ clang++-3.6 -fsyntax-only -std=c++11 input.cpp
    input.cpp:5:4: warning: 'X' is missing exception specification 'noexcept'
    X::X(X&&) = default;
       ^
	      noexcept
    input.cpp:2:5: note: previous declaration is here
	X(X&&) noexcept;
	^
    input.cpp:9:1: warning: control reaches end of non-void function [-Wreturn-type]
    }
    ^
    2 warnings generated.

$ clang++-3.8 -fsyntax-only -std=c++11 input.cpp
    input.cpp:5:4: error: 'X' is missing exception specification 'noexcept'
    X::X(X&&) = default;
       ^
	      noexcept
    input.cpp:2:5: note: previous declaration is here
	X(X&&) noexcept;
	^
    1 error generated.

Change-Id: I6d786a8b87eb4438fa8db36540db9358181b9a5b
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
2016-06-22 12:39:39 +00:00

9 lines
50 B
C++

int noReturnValue()
{
}
void f(int)
{
f();
}