Skip to content

Tpetra: fix clang compilation of test using clone

James Willenbring requested to merge tpetra_fixClangDeprecatedCompilation into develop

Created by: kddevin

@trilinos/tpetra

Description

Added TPETRA_ENABLE_DEPRECATED_CODE guards around test using CrsMatrix::clone

Motivation and Context

When compiling with clang and TPETRA_ENABLE_DEPRECATED_CODE=OFF, I got compiler errors.

/Users//code/Trilinos/packages/tpetra/core/test/CrsMatrix/CrsMatrix_NodeConversion.cpp:138:35: error: 'clone' following the 'template' keyword does not refer to a template
      RCP<Mat2> A2 = A1->template clone<N2>(n2,plClone);
                         ~~~~~~~~ ^~~~~
/Users//code/Trilinos/packages/tpetra/core/test/CrsMatrix/CrsMatrix_NodeConversion.cpp:138:40: error: expected unqualified-id
      RCP<Mat2> A2 = A1->template clone<N2>(n2,plClone);
                                       ^
/Users//code/Trilinos/packages/tpetra/core/test/CrsMatrix/CrsMatrix_NodeConversion.cpp:138:41: error: 'N2' does not refer to a value
      RCP<Mat2> A2 = A1->template clone<N2>(n2,plClone);
                                        ^
/Users//code/Trilinos/packages/tpetra/core/test/CrsMatrix/CrsMatrix_NodeConversion.cpp:104:65: note: declared here
  TEUCHOS_UNIT_TEST_TEMPLATE_1_DECL( CrsMatrix, NodeConversion, N2 )

Related Issues

#4900

How Has This Been Tested?

Mac using clang

-D Trilinos_ENABLE_Tpetra:BOOL=ON \
-D Tpetra_ENABLE_TESTS:BOOL=ON \
-D Tpetra_ENABLE_EXAMPLES:BOOL=ON \
-D Tpetra_ENABLE_DEPRECATED_CODE:BOOL=OFF \

Checklist

  • My commit messages mention the appropriate GitHub issue numbers.
  • My code follows the code style of the affected package(s).
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the code contribution guidelines for this project.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • No new compiler warnings were introduced.
  • These changes break backwards compatibility.

Merge request reports